Permalink
Browse files

Merge pull request #31 from nightwing/master

fix a typo
  • Loading branch information...
2 parents 63fd3bf + 6b441c2 commit 832c9cb23c1b72fac88ded96da65d0c7c66ef0e3 @nzakas nzakas committed Sep 10, 2012
Showing with 17 additions and 1 deletion.
  1. +1 −1 src/css/Parser.js
  2. +16 −0 tests/css/Parser.js
View
@@ -945,7 +945,7 @@ Parser.prototype = function(){
//there must be a next selector
if (nextSelector === null){
- this._unexpectedToken(this.LT(1));
+ this._unexpectedToken(tokenStream.LT(1));
} else {
//nextSelector is an instance of SelectorPart
View
@@ -1548,6 +1548,22 @@
var result = parser.parse(".foo {\n; color: #fff;\n}");
}
}));
+
+ suite.add(new YUITest.TestCase({
+
+ name: "Invalid CSS Parsing Tests",
+
+ "Test parsing invalid celector": function(){
+ var error;
+ var parser = new Parser();
+ parser.addListener("error", function(e){error = e});
+ parser.parse("c++{}");
+
+ Assert.areEqual("error", error.type);
+ Assert.areEqual(1, error.line);
+ Assert.areEqual(3, error.col);
+ }
+ }));
YUITest.TestRunner.add(suite);

0 comments on commit 832c9cb

Please sign in to comment.