Closed Bug 1164777 Opened 11 years ago Closed 11 years ago

super.prop erroneously disallowed inside eval inside arrow functions

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: efaust, Assigned: efaust)

Details

Attachments

(2 files)

The specese reads: It is a Syntax Error if StatementList Contains super unless the source code containing super is eval code that is being processed by a direct eval that is contained in function code that is not the function code of an ArrowFunction. To my read, this "is contained in" is not a formal function call, but rather means "it is within a non-arrow function". This means that eval inside an arrow function should work.
Jason, does this interpretation seem correct to you?
Flags: needinfo?(jorendorff)
(In reply to Eric Faust [:efaust] from comment #0) > The specese reads: > > It is a Syntax Error if StatementList Contains super unless the source code > containing super is eval code that is being processed by a direct eval that > is contained in function code that is not the function code of an > ArrowFunction. > > To my read, this "is contained in" is not a formal function call, but rather > means "it is within a non-arrow function". This means that eval inside an > arrow function should work. Rather, this should work as long as the immediately enclosing arrow function is eventually enclosed by a non-arrow function. So eval inside an arrow function inside a method should work, for example.
Comment on attachment 8605702 [details] [diff] [review] Part 1: Move evalStaticScope from BCE to GlobalSharedContext Review of attachment 8605702 [details] [diff] [review]: ----------------------------------------------------------------- Nice refactor. ::: js/src/frontend/Parser.cpp @@ +699,5 @@ > */ > Directives directives(options().strictOption); > + GlobalSharedContext globalsc(context, directives, > + /* evalScope = */ js::NullPtr(), > + options().extraWarningsOption, Side question: is this function only used by Reflect.parse? ::: js/src/frontend/SharedContext.h @@ +235,5 @@ > > class GlobalSharedContext : public SharedContext > { > private: > + Handle<StaticEvalObject*> evalScope_; Nit: I'd prefer this to be named staticEvalScope_. @@ +249,5 @@ > {} > > ObjectBox* toObjectBox() { return nullptr; } > bool allowSuperProperty() const { return allowSuperProperty_; } > + HandleObject evalStaticScope() const { return evalScope_; } Ditto, I'd prefer this to be named staticEvalScope()
Attachment #8605702 - Flags: review?(shu) → review+
Attachment #8605704 - Flags: review?(shu) → review+
(In reply to Eric Faust [:efaust] from comment #1) > Jason, does this interpretation seem correct to you? Hmm. The specese looks pretty dubious, but your interpretation is the only thing that makes any sense to me. +1. super.method() works inside eval inside arrow functions inside methods in anba's es6draft, FWIW.
Flags: needinfo?(jorendorff)
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: