File tree Expand file tree Collapse file tree 2 files changed +4
-26
lines changed Expand file tree Collapse file tree 2 files changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -118,25 +118,10 @@ function localizeNode(node, context) {
118
118
119
119
const localizeSelectors = ( selectors , mode ) => {
120
120
const node = Tokenizer . parse ( selectors ) ;
121
- var resultingGlobal ;
122
- node . nodes = node . nodes . map ( n => {
123
- var nContext = {
124
- global : mode === "global" ,
125
- lastWasSpacing : true ,
126
- hasLocals : false ,
127
- explicit : false
128
- } ;
129
- n = localizeNode ( n , nContext ) ;
130
- if ( typeof resultingGlobal === "undefined" ) {
131
- resultingGlobal = nContext . global ;
132
- } else if ( resultingGlobal !== nContext . global ) {
133
- throw Error (
134
- `Inconsistent rule global/local result in rule "${ Tokenizer . stringify ( node ) } "` +
135
- ` (multiple selectors must result in the same mode for the rule)`
136
- ) ;
137
- }
138
- return n ;
139
- } ) ;
121
+ const global = mode === "global" ;
122
+ node . nodes = node . nodes . map ( n =>
123
+ localizeNode ( n , { global, lastWasSpacing : true , hasLocals : false } )
124
+ ) ;
140
125
return Tokenizer . stringify ( node ) ;
141
126
} ;
142
127
Original file line number Diff line number Diff line change @@ -299,13 +299,6 @@ test("compile explict global attribute", () => {
299
299
} ) ;
300
300
} ) ;
301
301
302
- test ( "throw on inconsistent selector result" , ( ) => {
303
- return runError ( {
304
- fixture : ":global .foo, .bar {}" ,
305
- error : / I n c o n s i s t e n t /
306
- } ) ;
307
- } ) ;
308
-
309
302
test ( "throw on nested :locals" , ( ) => {
310
303
return runError ( {
311
304
fixture : ":local(:local(.foo)) {}" ,
You can’t perform that action at this time.
0 commit comments