summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/functions/constructor-basic.js
blob: 669bc77d962bfeab5133d42e8970869430aae8c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
load("test-common.js");

try {
  function Foo() {
    this.x = 123;
  }

  assert(Foo.prototype.constructor === Foo);

  var foo = new Foo();
  assert(foo.constructor === Foo);
  assert(foo.x === 123);

  console.log("PASS");
} catch (e) {
  console.log("FAIL: " + e);
}