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

Function test

deps/v8/test/webkit/fast/js/numeric-escapes-in-string-literals.js:28–40  ·  view source on GitHub ↗
(_stringLiteral, _nonStrictResult, _strictResult)

Source from the content-addressed store, hash-verified

26);
27
28function test(_stringLiteral, _nonStrictResult, _strictResult)
29{
30 stringLiteral = '"' + _stringLiteral + '"';
31 nonStrictResult = _nonStrictResult;
32 shouldBe("eval(stringLiteral)", "nonStrictResult");
33
34 stringLiteral = '"use strict"; ' + stringLiteral;
35 if (_strictResult) {
36 strictResult = _strictResult;
37 shouldBe("eval(stringLiteral)", "strictResult");
38 } else
39 shouldThrow("eval(stringLiteral)");
40}
41
42// Tests for single digit octal and decimal escapes.
43// In non-strict mode 0-7 are octal escapes, 8-9 are NonEscapeCharacters.

Calls 2

shouldBeFunction · 0.50
shouldThrowFunction · 0.50

Tested by

no test coverage detected