vendor/node_modules/cssom/lib/parse.js in stylus-source-0.28.1 vs vendor/node_modules/cssom/lib/parse.js in stylus-source-0.28.2
- old
+ new
@@ -1,16 +1,7 @@
//.CommonJS
-var CSSOM = {
- CSSStyleSheet: require("./CSSStyleSheet").CSSStyleSheet,
- CSSStyleRule: require("./CSSStyleRule").CSSStyleRule,
- CSSImportRule: require("./CSSImportRule").CSSImportRule,
- CSSMediaRule: require("./CSSMediaRule").CSSMediaRule,
- CSSFontFaceRule: require("./CSSFontFaceRule").CSSFontFaceRule,
- CSSStyleDeclaration: require('./CSSStyleDeclaration').CSSStyleDeclaration,
- CSSKeyframeRule: require('./CSSKeyframeRule').CSSKeyframeRule,
- CSSKeyframesRule: require('./CSSKeyframesRule').CSSKeyframesRule
-};
+var CSSOM = {};
///CommonJS
/**
* @param {string} token
@@ -56,11 +47,11 @@
var atKeyframesRegExp = /@(-(?:\w+-)+)?keyframes/g;
var parseError = function(message) {
var lines = token.substring(0, i).split('\n');
var lineCount = lines.length;
- var charCount = lines.pop().length;
+ var charCount = lines.pop().length + 1;
var error = new Error(message + ' (line ' + lineCount + ', char ' + charCount + ')');
error.line = lineCount;
error.char = charCount;
error.styleSheet = styleSheet;
throw error;
@@ -333,6 +324,15 @@
};
//.CommonJS
exports.parse = CSSOM.parse;
+// The following modules cannot be included sooner due to the mutual dependency with parse.js
+CSSOM.CSSStyleSheet = require("./CSSStyleSheet").CSSStyleSheet;
+CSSOM.CSSStyleRule = require("./CSSStyleRule").CSSStyleRule;
+CSSOM.CSSImportRule = require("./CSSImportRule").CSSImportRule;
+CSSOM.CSSMediaRule = require("./CSSMediaRule").CSSMediaRule;
+CSSOM.CSSFontFaceRule = require("./CSSFontFaceRule").CSSFontFaceRule;
+CSSOM.CSSStyleDeclaration = require('./CSSStyleDeclaration').CSSStyleDeclaration;
+CSSOM.CSSKeyframeRule = require('./CSSKeyframeRule').CSSKeyframeRule;
+CSSOM.CSSKeyframesRule = require('./CSSKeyframesRule').CSSKeyframesRule;
///CommonJS