archives

« Bugzilla Issues Index

#3306 — Make class name TDZ in extends expression


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.


sounds reasonable.


fixed in rev30 editor's draft


fixed in rev30