[Webkit-unassigned] [Bug 153981] [ES6] Arrow function syntax. Emit loading&putting this/super only if they are used in arrow function

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 21 15:18:56 PST 2016


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

Saam Barati <sbarati at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #271854|review?, commit-queue?      |review+, commit-queue-
              Flags|                            |

--- Comment #19 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 271854
  --> https://bugs.webkit.org/attachment.cgi?id=271854
Patch

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

r=me w/ comments.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4050
> +    return m_codeBlock->doAnyInnerArrowFunctionsUseNewTarget() || m_codeBlock->doAnyInnerArrowFunctionsUseSuperCall() || m_codeBlock->doAnyInnerArrowFunctionsUseEval();

I was wrong about this. new.target is prohibited inside eval. Sorry for stating the wrong thing in my previous review.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:4055
> +    return m_codeBlock->doAnyInnerArrowFunctionsUseSuperCall() || m_codeBlock->doAnyInnerArrowFunctionsUseSuperProperty() || m_codeBlock->doAnyInnerArrowFunctionsUseEval() || m_codeBlock->usesEval();

Also, 'super' isn't allowed inside an eval. It's a SyntaxError.

> Source/JavaScriptCore/parser/Parser.h:473
> +        if (m_isArrowFunction && m_usesEval)
> +            setInnerArrowFunctionUseEval();
> +        
> +        if (m_isArrowFunction && m_vm->propertyNames->arguments == *ident)
> +            setInnerArrowFunctionUseArgumetns();

An alternative to doing this at every useVariable(.) call
is to just do it once when popScope happens.

> Source/JavaScriptCore/parser/Parser.h:953
> +        // We do not up arrow function features for ordinary function

comment not needed.

-- 
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/20160221/18269682/attachment.html>


More information about the webkit-unassigned mailing list