Status: New
Owner: ----

New issue 359 by ayembee: comments at the end of a line can cause the JS  
compiler to fail with "Unexpected end of input"
http://code.google.com/p/v8/issues/detail?id=359

The following compiles and runs correctly with no errors. Calling
getVarFromMyNewClass() returns "42" as expected.

--------------------

function MyClass() {
     this.the_answer = 42;
     this.getVariable = function() { return this.the_answer; };
}
function getVarFromMyNewClass() {
     var inst_class = new MyClass();
     return inst_class.getVariable();
}
--------------------

But the identical code with an end-of-line comment (which should be legal
in JS) fails to compile, throwing the following "SyntaxError: Unexpected
end of input":

--------------------

function MyClass() {
     this.the_answer = 42;
     this.getVariable = function() { return this.the_answer; };
}
function getVarFromMyNewClass() {
     var inst_class = new MyClass(); // instantiate class
     return inst_class.getVariable();
}
--------------------

Regards.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to