[Webkit-unassigned] [Bug 144956] [ES6] Implement ES6 arrow function syntax. Arrow function specific features. Lexical bind of this

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 27 11:43:07 PDT 2015


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

--- Comment #69 from Saam Barati <saambarati1 at gmail.com> ---
Comment on attachment 257562
  --> https://bugs.webkit.org/attachment.cgi?id=257562
Patch

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

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:515
> +        m_arrowFunctionThisRegister = addVar();

This shouldn't be an addVar(). It should be a temporary.
Also, I'd put this "if" statement above the "m_TDZStack.append(...)" line.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:2201
> +#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)

You don't need guars here.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:304
> +        RegisterID* arrowFunctionThisRegister() { return m_arrowFunctionThisRegister; }

Don't need this.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:481
> +#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)

You don't need guards here.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:483
> +        RegisterID* emitThisNodeBytecode(RegisterID*, JSTextPosition);

This looks like it should be removed.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:766
> +        RegisterID* m_arrowFunctionThisRegister { nullptr };

We don't need this to be a field.

> Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:3070
> +#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)    

Don't need guards here.

> Source/JavaScriptCore/parser/NodeConstructors.h:848
> +#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)

Don't need guards here.

> Source/JavaScriptCore/parser/Nodes.h:167
> +#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)

ditto.

> Source/JavaScriptCore/parser/Nodes.h:1742
> +#if ENABLE(ES6_ARROWFUNCTION_SYNTAX)

ditto.

> Source/JavaScriptCore/runtime/CommonIdentifiers.h:187
> +    macro(__private_arrowfunction_this__) \

You probably want this under the "JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME" macro.
Also, there is no need to make this a crazy name with underscores. Just call it "arrowFunctionBoundThis" or something
similar. Also, make sure that this property is not visible to JS code.

> Source/JavaScriptCore/runtime/JSFunction.cpp:132
> +void JSFunction::finishCreation(VM& vm)

Is this called?

> Source/JavaScriptCore/runtime/JSFunction.h:147
>      using Base::finishCreation;

Maybe we no longer want this line?

-- 
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/20150727/39fe972b/attachment-0001.html>


More information about the webkit-unassigned mailing list