blob: ca18c1b4de731b6b4fda7957b8d67cce8f4d2f23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
var class_scope_weird = require("class_scope_weird");
f = new class_scope_weird.Foo();
g = new class_scope_weird.Foo(3);
if (f.bar(3) != 3)
throw RuntimeError;
// Test missing new keyword during constructor call
var caughtException = false;
try {
g = class_scope_weird.Foo(4);
} catch (err) {
caughtException = true;
}
if (!caughtException) {
throw new Error("Instantiation exception not thrown");
}
|