Open GoogleCodeExporter opened 9 years ago
The resulting change to the code is correct per the style guide that gjslint
and fixjsstyle enforce. You are assigning one of two possible values based on
the condition evaluation, the linter sees that and asserts that an expression
should end with a semicolon per the ECMAScript rules for ASI.
While fixjsstyle 'breaks' the code, is this a case of a broken implementation?
I don't think so, look at it like this: If you are truly trying to stringify a
function then why not use a function expression?
var someMethod = function() {
return 'in someMethod';
};
alert(callback || someMethod);
http://ecma-international.org/ecma-262/5.1/#sec-7.9
Original comment by harpe...@gmail.com
on 24 Feb 2013 at 5:00
Issue 57 has been merged into this issue.
Original comment by rum...@google.com
on 15 Jan 2015 at 8:56
Original issue reported on code.google.com by
guido.tapia@gmail.com
on 3 Oct 2012 at 6:00