Espruino/tests/test_function_call.js
2013-10-10 18:37:09 +01:00

17 lines
236 B
JavaScript

function A(a, b) {
this.a = a;
this.b = b;
return this;
}
function B(a, b) {
A.call(this, a, b);
this.c = 42;
}
B.prototype = new A();
var x = new B('hello', 'world');
result = x.a == 'hello' && x.b == 'world' && x.c==42;