Skip to content

Commit f9ffa40

Browse files
committed
Remove inconsistency checking
1 parent 495873e commit f9ffa40

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/index.js

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,10 @@ function localizeNode(node, context) {
118118

119119
const 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

test/test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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: /Inconsistent/
306-
});
307-
});
308-
309302
test("throw on nested :locals", () => {
310303
return runError({
311304
fixture: ":local(:local(.foo)) {}",

0 commit comments

Comments
 (0)