Skip to content

Commit

Permalink
Updated test262 status for Function.prototype.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
tuchida authored and gbrail committed Jul 17, 2024
1 parent a003683 commit 5bdd291
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.mozilla.javascript.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mozilla.javascript.drivers.TestUtils.JS_FILE_FILTER;
import static org.mozilla.javascript.drivers.TestUtils.recursiveListFilesHelper;
Expand Down Expand Up @@ -499,11 +500,28 @@ private Scriptable buildScope(Context cx, Test262Case testCase, int optLevel)

// fix for missing features in Rhino
if ("compareArray.js".equalsIgnoreCase(harnessFile)) {
assertTrue(
UNSUPPORTED_FEATURES.contains(
"default-parameters"));
script =
script.replace(
"assert.compareArray = function(actual, expected, message = '')",
"assert.compareArray = function(actual, expected, message)");
}
// fix for missing features in Rhino
if ("nativeFunctionMatcher.js".equalsIgnoreCase(harnessFile)) {
assertTrue(
UNSUPPORTED_FEATURES.contains(
"regexp-unicode-property-escapes"));
script =
script.replace(
"const isNewline = (c) => /[\\u000A\\u000D\\u2028\\u2029]/u.test(c);",
"const isNewline = (c) => /[\\u000A\\u000D\\u2028\\u2029]/.test(c);");
script =
script.replace(
"const isWhitespace = (c) => /[\\u0009\\u000B\\u000C\\u0020\\u00A0\\uFEFF]/u.test(c)",
"const isWhitespace = (c) => /[\\u0009\\u000B\\u000C\\u0020\\u00A0\\uFEFF]/.test(c)");
}
return cx.compileString(script, harnessPath, 1, null);
} catch (IOException ioe) {
throw new RuntimeException(
Expand Down
9 changes: 1 addition & 8 deletions tests/testsrc/test262.properties
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ built-ins/eval 2/9 (22.22%)
length-non-configurable.js
private-identifiers-not-empty.js {unsupported: [class-fields-private]}

built-ins/Function 186/505 (36.83%)
built-ins/Function 179/505 (35.45%)
internals/Call 2/2 (100.0%)
internals/Construct 6/6 (100.0%)
length/S15.3.5.1_A1_T3.js strict
Expand Down Expand Up @@ -502,7 +502,6 @@ built-ins/Function 186/505 (36.83%)
prototype/Symbol.hasInstance/value-negative.js
prototype/Symbol.hasInstance/value-non-obj.js
prototype/Symbol.hasInstance/value-positive.js
prototype/toString/arrow-function.js
prototype/toString/async-arrow-function.js {unsupported: [async-functions]}
prototype/toString/async-function-declaration.js {unsupported: [async-functions]}
prototype/toString/async-function-expression.js {unsupported: [async-functions]}
Expand All @@ -528,9 +527,7 @@ built-ins/Function 186/505 (36.83%)
prototype/toString/class-expression-explicit-ctor.js
prototype/toString/class-expression-implicit-ctor.js
prototype/toString/Function.js
prototype/toString/function-declaration.js
prototype/toString/function-declaration-non-simple-parameter-list.js
prototype/toString/function-expression.js
prototype/toString/generator-function-declaration.js
prototype/toString/generator-function-expression.js
prototype/toString/generator-method.js
Expand All @@ -540,9 +537,6 @@ built-ins/Function 186/505 (36.83%)
prototype/toString/getter-class-statement.js
prototype/toString/getter-class-statement-static.js
prototype/toString/getter-object.js
prototype/toString/line-terminator-normalisation-CR.js
prototype/toString/line-terminator-normalisation-CR-LF.js
prototype/toString/line-terminator-normalisation-LF.js
prototype/toString/method-class-expression.js
prototype/toString/method-class-expression-static.js
prototype/toString/method-class-statement.js
Expand Down Expand Up @@ -570,7 +564,6 @@ built-ins/Function 186/505 (36.83%)
prototype/toString/setter-class-statement-static.js
prototype/toString/setter-object.js
prototype/toString/symbol-named-builtins.js
prototype/toString/unicode.js
prototype/restricted-property-arguments.js
prototype/restricted-property-caller.js
prototype/S15.3.4_A5.js
Expand Down

0 comments on commit 5bdd291

Please sign in to comment.