Remove print calls in sm/syntax

This commit is contained in:
André Bargull 2025-04-30 14:16:06 +02:00 committed by Philip Chimento
parent e79abfc182
commit b58523b3f9
8 changed files with 8 additions and 129 deletions

View File

@ -8,20 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Properly implement the spec's distinctions between StatementListItem and Statement grammar productions and their uses
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1288459;
var summary =
"Properly implement the spec's distinctions between StatementListItem and " +
"Statement grammar productions and their uses";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
assert.throws(SyntaxError, () => Function("a: let x;")); assert.throws(SyntaxError, () => Function("a: let x;"));
assert.throws(SyntaxError, () => Function("b: const y = 3;")); assert.throws(SyntaxError, () => Function("b: const y = 3;"));
@ -33,7 +22,3 @@ assert.throws(SyntaxError, () => Function("'use strict'; d: function w() {};"));
Function("e: function x() {};"); Function("e: function x() {};");
assert.throws(SyntaxError, () => Function("f: function* y() {}")); assert.throws(SyntaxError, () => Function("f: function* y() {}"));
/******************************************************************************/
print("Tests complete");

View File

@ -8,21 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending |let| and |static| are forbidden as Identifier only in strict mode code, and it's permissible to use them as Identifier (with or without containing escapes) in non-strict code
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1288460;
var summary =
"|let| and |static| are forbidden as Identifier only in strict mode code, " +
"and it's permissible to use them as Identifier (with or without " +
"containing escapes) in non-strict code";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function t(code) function t(code)
{ {
@ -44,7 +32,3 @@ t("st\\u0061tic: 42;");
t("if (1) st\\u0061tic: 42;"); t("if (1) st\\u0061tic: 42;");
t("st\\u0061tic = 42;"); t("st\\u0061tic = 42;");
t("if (1) st\\u0061tic = 42;"); t("if (1) st\\u0061tic = 42;");
/******************************************************************************/
print("Tests complete");

View File

@ -8,20 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Escape sequences aren't allowed in bolded grammar tokens (that is, in keywords, possibly contextual keywords)
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1204027;
var summary =
"Escape sequences aren't allowed in bolded grammar tokens (that is, in " +
"keywords, possibly contextual keywords)";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function memberVariants(code) function memberVariants(code)
{ {
@ -67,7 +56,3 @@ var badScripts =
for (var script of badScripts) for (var script of badScripts)
assert.throws(SyntaxError, () => Function(script)); assert.throws(SyntaxError, () => Function(script));
/******************************************************************************/
print("Tests complete");

View File

@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending let can't be used as a label in strict mode code
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1288459;
var summary = "let can't be used as a label in strict mode code";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
Function("let: 42"); Function("let: 42");
Function("l\\u0065t: 42"); Function("l\\u0065t: 42");
@ -34,7 +25,3 @@ assert.throws(SyntaxError, () => eval(" 'use strict'; let: 42"));
assert.throws(SyntaxError, () => eval(" 'use strict' \n let: 42;")); assert.throws(SyntaxError, () => eval(" 'use strict' \n let: 42;"));
assert.throws(SyntaxError, () => eval(" 'use strict'; l\\u0065t: 42")); assert.throws(SyntaxError, () => eval(" 'use strict'; l\\u0065t: 42"));
assert.throws(SyntaxError, () => eval(" 'use strict' \n l\\u0065t: 42;")); assert.throws(SyntaxError, () => eval(" 'use strict' \n l\\u0065t: 42;"));
/******************************************************************************/
print("Tests complete");

View File

@ -8,22 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Properly handle the case of U+005C REVERSE SOLIDUS U+000D CARRIAGE RETURN at the end of source text being tokenized, in the middle of a string or template literal, where the next code point in memory (outside the bounds of the source text) is U+000A LINE FEED
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1476409;
var summary =
"Properly handle the case of U+005C REVERSE SOLIDUS U+000D CARRIAGE RETURN " +
"at the end of source text being tokenized, in the middle of a string or " +
"template literal, where the next code point in memory (outside the bounds " +
"of the source text) is U+000A LINE FEED";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function expectSyntaxError(code) function expectSyntaxError(code)
{ {
@ -87,7 +74,3 @@ function template()
expectSyntaxError(containsBadTemplateLiteral.substr(2, 53)); expectSyntaxError(containsBadTemplateLiteral.substr(2, 53));
} }
template(); template();
/******************************************************************************/
print("Tests complete");

View File

@ -8,21 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Properly evaluate a bigint literal that's initially tokenized by a syntax parser (because the bigint literal appears immediately after an arrow function with expression body)
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1596706;
var summary =
"Properly evaluate a bigint literal that's initially tokenized by a syntax " +
"parser (because the bigint literal appears immediately after an arrow " +
"function with expression body)";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
// block followed by semicolon // block followed by semicolon
assert.sameValue(eval(`x=>{}; assert.sameValue(eval(`x=>{};
@ -39,7 +27,3 @@ assert.sameValue(eval(`x=>y;
// expr not followed by semicolon // expr not followed by semicolon
assert.sameValue(eval(`x=>y assert.sameValue(eval(`x=>y
78051120n`), 78051120n); 78051120n`), 78051120n);
/******************************************************************************/
print("Tests complete");

View File

@ -8,21 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Properly apply a directive comment that's only tokenized by a syntax parser (because the directive comment appears immediately after an arrow function with expression body)
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1596706;
var summary =
"Properly apply a directive comment that's only tokenized by a syntax " +
"parser (because the directive comment appears immediately after an arrow " +
"function with expression body)";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var stack; var stack;
@ -71,7 +59,3 @@ assert.sameValue(eval(`x=>y
//# sourceURL=http://example.com/quux.js //# sourceURL=http://example.com/quux.js
detectSourceURL`), 17); detectSourceURL`), 17);
assertStackContains("http://example.com/quux.js", "expr, not semi"); assertStackContains("http://example.com/quux.js", "expr, not semi");
/******************************************************************************/
print("Tests complete");

View File

@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending |yield| is sometimes a valid identifier
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 1288459;
var summary = "|yield| is sometimes a valid identifier";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var g = $262.createRealm().global; var g = $262.createRealm().global;
@ -40,7 +31,3 @@ t("const yield = 3;");
t("for (var yield = 3; ; ) break;"); t("for (var yield = 3; ; ) break;");
t("for (let yield = 3; ; ) break;"); t("for (let yield = 3; ; ) break;");
t("for (const yield = 3; ; ) break;"); t("for (const yield = 3; ; ) break;");
/******************************************************************************/
print("Tests complete");