File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,25 +118,10 @@ function localizeNode(node, context) {
118118
119119const localizeSelectors = ( selectors , mode ) => {
120120 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+ ) ;
140125 return Tokenizer . stringify ( node ) ;
141126} ;
142127
Original file line number Diff line number Diff line change @@ -299,13 +299,6 @@ test("compile explict global attribute", () => {
299299 } ) ;
300300} ) ;
301301
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-
309302test ( "throw on nested :locals" , ( ) => {
310303 return runError ( {
311304 fixture : ":local(:local(.foo)) {}" ,
You can’t perform that action at this time.
0 commit comments