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

Function test

deps/v8/test/mjsunit/es6/destructuring-assignment.js:246–258  ·  view source on GitHub ↗
(value, initializer, expected)

Source from the content-addressed store, hash-verified

244
245(function testArrayElementInitializer() {
246 function test(value, initializer, expected) {
247 var a, obj = {};
248 var initialized = false;
249 var shouldBeInitialized = value[0] === undefined;
250 assertEquals(value, [ a = (initialized = true, initializer) ] = value);
251 assertEquals(expected, a);
252 assertEquals(shouldBeInitialized, initialized);
253
254 var initialized2 = false;
255 assertEquals(value, [ obj.a = (initialized2 = true, initializer) ] = value);
256 assertEquals(expected, obj.a);
257 assertEquals(shouldBeInitialized, initialized2);
258 }
259
260 test([], "BAM!", "BAM!");
261 test([], "BOOP!", "BOOP!");

Callers 1

Calls 1

assertEqualsFunction · 0.50

Tested by

no test coverage detected