MCPcopy Index your code
hub / github.com/nodejs/node / CheckScopeContent

Function CheckScopeContent

deps/v8/test/debugger/debug/es6/debug-blockscopes.js:102–134  ·  view source on GitHub ↗
(content, number, exec_state)

Source from the content-addressed store, hash-verified

100// Check that the content of the scope is as expected. For functions just check
101// that there is a function.
102function CheckScopeContent(content, number, exec_state) {
103 var scope = exec_state.frame().scope(number);
104 var count = 0;
105 for (var p in content) {
106 var property_mirror = scope.scopeObject().property(p);
107 if (property_mirror.isUndefined()) {
108 print('property ' + p + ' not found in scope');
109 }
110 assertFalse(property_mirror.isUndefined(),
111 'property ' + p + ' not found in scope');
112 assertEquals(content[p], property_mirror.value().value(),
113 'property ' + p + ' has unexpected value');
114 count++;
115 }
116
117 // 'arguments' and might be exposed in the local and closure scope. Just
118 // ignore this.
119 var scope_size = scope.scopeObject().properties().length;
120 if (!scope.scopeObject().property('arguments').isUndefined()) {
121 scope_size--;
122 }
123 // Temporary variables introduced by the parser have not been materialized.
124 assertTrue(scope.scopeObject().property('').isUndefined());
125
126 if (count != scope_size) {
127 print('Names found in scope:');
128 var names = scope.scopeObject().propertyNames();
129 for (var i = 0; i < names.length; i++) {
130 print(names[i]);
131 }
132 }
133 assertEquals(count, scope_size);
134}
135
136
137function assertEqualsUnlessOptimized(expected, value, f) {

Callers 1

Calls 7

printFunction · 0.50
assertFalseFunction · 0.50
assertEqualsFunction · 0.50
assertTrueFunction · 0.50
propertyMethod · 0.45
valueMethod · 0.45
propertyNamesMethod · 0.45

Tested by

no test coverage detected