MCPcopy Create free account
hub / github.com/nodejs/node / test

Function test

deps/v8/test/webkit/fast/js/kde/func-decl.js:42–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40f = "global";
41
42function test() {
43 try {
44 shouldBeOfType("Function declaration takes effect at entry", f, "function");
45 }
46 catch (e) {
47 testFailed("Scoping very broken!");
48 }
49
50 for (var i = 0; i < 3; ++i) {
51 if (i == 0)
52 shouldBeOfType("Decl not yet overwritten", f, 'function');
53 else
54 shouldBeOfType("Decl already overwritten", f, 'number');
55
56 f = 3;
57 shouldBeVal("After assign ("+i+")", f, 3);
58
59 function f() {};
60 shouldBeVal("function decls have no execution content", f, 3);
61
62 f = 5;
63
64 shouldBeVal("After assign #2 ("+i+")", f, 5);
65 }
66}
67
68test();

Callers 1

func-decl.jsFile · 0.70

Calls 3

testFailedFunction · 0.85
shouldBeValFunction · 0.85
shouldBeOfTypeFunction · 0.70

Tested by

no test coverage detected