[Webkit-unassigned] [Bug 155491] [ES6] Arrow function syntax. Update syntax error text 'super is only valid inside functions' to more suitable

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Mar 19 10:43:34 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=155491

--- Comment #4 from GSkachkov <gskachkov at gmail.com> ---
Comment on attachment 274515
  --> https://bugs.webkit.org/attachment.cgi?id=274515
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=274515&action=review

>> Source/JavaScriptCore/parser/Parser.cpp:3847
>> +        semanticFailIfFalse(currentScope()->isFunction() || (scopeRef->isEvalContext() && scopeRef->expectedSuperBinding() == SuperBinding::Needed), "super is only valid inside functions or 'eval' inside a function");
> 
> I vote for this message:
> "'super' is only valid inside a function or an 'eval' inside a function"
> 
> Do you know what we do when we have 'super' inside a function not in a class?
> It looks like we accept that syntax. Do we throw a runtime error? Should that also
> be a syntax error?

OK. I'll change text message.

According to the super inside a function not in a class, we will have syntax error also We have additional check if current function is constructor or method of class:
http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/parser/Parser.cpp#L2078

>> Source/JavaScriptCore/tests/stress/generator-with-super.js:12
>> +    //debug(error);
> 
> Remove

Ups...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160319/7ad970f3/attachment.html>


More information about the webkit-unassigned mailing list