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

Function testShadowing

deps/v8/test/mjsunit/arguments-load-across-eval.js:66–82  ·  view source on GitHub ↗
(x, h)

Source from the content-addressed store, hash-verified

64
65// Test loading across an eval call that shadows variables.
66function testShadowing(x, h) {
67 function f() {
68 assertEquals(1, x);
69 assertEquals(2, h());
70 eval('var x = 3; var h = function() { return 4; };');
71 assertEquals(3, x);
72 assertEquals(4, h());
73 function g() {
74 assertEquals(3, x);
75 assertEquals(4, h());
76 }
77 g();
78 }
79 f();
80 assertEquals(1, x);
81 assertEquals(2, h());
82}
83
84testShadowing(1, function() { return 2; });

Callers 1

Calls 3

fFunction · 0.70
assertEqualsFunction · 0.50
hFunction · 0.50

Tested by

no test coverage detected