Skip to content
Browse files

fix typo

  • Loading branch information...
1 parent 63fd3bf commit 6b441c286129ab183d7206156faeae57d916e782 @nightwing 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
2 src/css/Parser.js
@@ -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
16 tests/css/Parser.js
@@ -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 6b441c2

Please sign in to comment.
Something went wrong with that request. Please try again.