« Bugzilla Issues Index
#3306 — Make class name TDZ in extends expression
- bug_id:
3306
- creation_ts:
2014-11-04 08:54:00 -0800
- short_desc:
Make class name TDZ in extends expression
- delta_ts:
2015-07-10 08:34:17 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 28: October 14, 2014 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
Erik Arvidsson
- assigned_to:
Allen Wirfs-Brock
- cc:
["andrebargull", "dslomov", "erik.arvidsson"]
- commentid:
10552
- comment_count:
0
- who:
Erik Arvidsson
- bug_when:
2014-11-04 08:54:07 -0800
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-classdefinitionevaluation
Today, the extends expression is evaluated before the lexical environment for the class body is created. This makes the following valid:
var B = class {};
var C = class B extends B {};
assert(C.prototype instance of B);
I think it would be simpler if step 4 & 5 were moved to before the current step 1. Then the above code would be an error due to the TDZ.
- commentid:
10553
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2014-11-04 09:33:36 -0800
sounds reasonable.
- commentid:
10972
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2014-12-08 17:32:27 -0800
fixed in rev30 editor's draft
- commentid:
11161
- comment_count:
3
- who:
Allen Wirfs-Brock
- bug_when:
2014-12-23 20:23:26 -0800
fixed in rev30