Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a typo #31

Merged
merged 1 commit into from
Sep 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/css/Parser.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ Parser.prototype = function(){


//there must be a next selector //there must be a next selector
if (nextSelector === null){ if (nextSelector === null){
this._unexpectedToken(this.LT(1)); this._unexpectedToken(tokenStream.LT(1));
} else { } else {


//nextSelector is an instance of SelectorPart //nextSelector is an instance of SelectorPart
Expand Down
16 changes: 16 additions & 0 deletions tests/css/Parser.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1548,6 +1548,22 @@
var result = parser.parse(".foo {\n; color: #fff;\n}"); 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); YUITest.TestRunner.add(suite);
Expand Down