ericmckean / traceur-compiler

Automatically exported from code.google.com/p/traceur-compiler
Apache License 2.0
0 stars 0 forks source link

Arrow functions should not have [[Construct]] #208

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
    new () => console.log("foo")

becomes

    new (function() {
      return console.log("foo");
    });

which does not throw a TypeError.

Per the latest ES6 draft, arrow function definitions only invoke the 
FunctionCreate abstract operation, whereas function expressions and function 
declarations also invoke MakeConstructor on the created function.

Original issue reported on code.google.com by dome...@domenicdenicola.com on 4 Mar 2013 at 5:41