@@ -31,13 +31,11 @@ function localizeNode(node, context) {
31
31
case "selectors" :
32
32
var resultingGlobal ;
33
33
context . hasPureGlobals = false ;
34
- context . hasPureImplicitGlobals = false ;
35
34
newNodes = node . nodes . map ( function ( n ) {
36
35
var nContext = {
37
36
global : context . global ,
38
37
lastWasSpacing : true ,
39
38
hasLocals : false ,
40
- hasImplicitGlobals : false ,
41
39
explicit : false
42
40
} ;
43
41
n = localizeNode ( n , nContext ) ;
@@ -49,9 +47,6 @@ function localizeNode(node, context) {
49
47
}
50
48
if ( ! nContext . hasLocals ) {
51
49
context . hasPureGlobals = true ;
52
- if ( nContext . hasImplicitGlobals ) {
53
- context . hasPureImplicitGlobals = true ;
54
- }
55
50
}
56
51
return n ;
57
52
} ) ;
@@ -101,7 +96,6 @@ function localizeNode(node, context) {
101
96
global : ( node . name === "global" ) ,
102
97
inside : node . name ,
103
98
hasLocals : false ,
104
- hasImplicitGlobals : false ,
105
99
explicit : true
106
100
} ;
107
101
node = node . nodes . map ( function ( n ) {
@@ -116,7 +110,6 @@ function localizeNode(node, context) {
116
110
inside : context . inside ,
117
111
lastWasSpacing : true ,
118
112
hasLocals : false ,
119
- hasImplicitGlobals : false ,
120
113
explicit : context . explicit
121
114
} ;
122
115
newNodes = node . nodes . map ( function ( n ) {
@@ -128,9 +121,6 @@ function localizeNode(node, context) {
128
121
if ( subContext . hasLocals ) {
129
122
context . hasLocals = true ;
130
123
}
131
- if ( subContext . hasImplicitGlobals ) {
132
- context . hasImplicitGlobals = true ;
133
- }
134
124
break ;
135
125
136
126
case "id" :
@@ -228,8 +218,7 @@ module.exports = postcss.plugin('postcss-modules-local-by-default', function (op
228
218
var context = {
229
219
options : options ,
230
220
global : globalMode ,
231
- hasPureGlobals : false ,
232
- hasPureImplicitGlobals : false
221
+ hasPureGlobals : false
233
222
} ;
234
223
var newSelector ;
235
224
try {
@@ -241,10 +230,6 @@ module.exports = postcss.plugin('postcss-modules-local-by-default', function (op
241
230
throw rule . error ( "Selector '" + Tokenizer . stringify ( selector ) + "' is not pure " +
242
231
"(pure selectors must contain at least one local class or id)" ) ;
243
232
}
244
- if ( ! globalMode && context . hasPureImplicitGlobals ) {
245
- throw rule . error ( "Selector '" + Tokenizer . stringify ( selector ) + "' must be explicit flagged :global " +
246
- "(elsewise it would leak globally)" ) ;
247
- }
248
233
rule . nodes . forEach ( function ( decl ) {
249
234
localizeDecl ( decl , context ) ;
250
235
} ) ;
0 commit comments