mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
NewExpression mostly piggybacks on the existing CallExpression. The big difference is that "new" creates a new Object and passes it as |this| to the callee.
8 lines
103 B
JavaScript
8 lines
103 B
JavaScript
function Foo() {
|
|
this.x = 123;
|
|
}
|
|
|
|
var foo = new Foo();
|
|
if (foo.x === 123)
|
|
console.log("PASS");
|