mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Remove reportMatch
This commit is contained in:
parent
a06e66989b
commit
e778def1d1
@ -1,5 +1,5 @@
|
|||||||
/*---
|
/*---
|
||||||
defines: [assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, newGlobal, print, assertEq, reportCompare, reportMatch, createIsHTMLDDA, createExternalArrayBuffer]
|
defines: [assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, newGlobal, print, assertEq, reportCompare, createIsHTMLDDA, createExternalArrayBuffer]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function assertThrownErrorContains(f, substr) {
|
function assertThrownErrorContains(f, substr) {
|
||||||
@ -43,13 +43,6 @@ function reportCompare(...args) {
|
|||||||
assert.sameValue(...args)
|
assert.sameValue(...args)
|
||||||
}
|
}
|
||||||
|
|
||||||
function reportMatch(expectedRegExp, actual, description = "") {
|
|
||||||
assert.sameValue(typeof actual, "string",
|
|
||||||
`Type mismatch, expected string, actual type ${typeof actual}`);
|
|
||||||
assert.notSameValue(expectedRegExp.exec(actual), null,
|
|
||||||
`Expected match to '${expectedRegExp}', Actual value '${actual}'`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (globalThis.createIsHTMLDDA === undefined) {
|
if (globalThis.createIsHTMLDDA === undefined) {
|
||||||
globalThis.createIsHTMLDDA = function createIsHTMLDDA() {
|
globalThis.createIsHTMLDDA = function createIsHTMLDDA() {
|
||||||
return $262.IsHTMLDDA;
|
return $262.IsHTMLDDA;
|
||||||
|
@ -2,52 +2,29 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
includes: [sm/non262.js, sm/non262-shell.js]
|
includes: [nativeFunctionMatcher.js]
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
// Greatly (!) simplified patterns for the PropertyName production.
|
|
||||||
var propertyName = [
|
|
||||||
// PropertyName :: LiteralPropertyName :: IdentifierName
|
|
||||||
"\\w+",
|
|
||||||
|
|
||||||
// PropertyName :: LiteralPropertyName :: StringLiteral
|
|
||||||
"(?:'[^']*')",
|
|
||||||
"(?:\"[^\"]*\")",
|
|
||||||
|
|
||||||
// PropertyName :: LiteralPropertyName :: NumericLiteral
|
|
||||||
"\\d+",
|
|
||||||
|
|
||||||
// PropertyName :: ComputedPropertyName
|
|
||||||
"(?:\\[[^\\]]+\\])",
|
|
||||||
].join("|")
|
|
||||||
|
|
||||||
var nativeCode = RegExp([
|
|
||||||
"^", "function", "(get|set)?", ("(" + propertyName + ")?"), "\\(", "\\)", "\\{", "\\[native code\\]", "\\}", "$"
|
|
||||||
].join("\\s*"));
|
|
||||||
|
|
||||||
|
|
||||||
// Bound functions are considered built-ins.
|
// Bound functions are considered built-ins.
|
||||||
reportMatch(nativeCode, function(){}.bind().toString());
|
assertNativeFunction(function(){}.bind());
|
||||||
reportMatch(nativeCode, function fn(){}.bind().toString());
|
assertNativeFunction(function fn(){}.bind());
|
||||||
|
|
||||||
// Built-ins which are well-known intrinsic objects.
|
// Built-ins which are well-known intrinsic objects.
|
||||||
reportMatch(nativeCode, Array.toString());
|
assertNativeFunction(Array);
|
||||||
reportMatch(nativeCode, Object.prototype.toString.toString());
|
assertNativeFunction(Object.prototype.toString);
|
||||||
reportMatch(nativeCode, decodeURI.toString());
|
assertNativeFunction(decodeURI);
|
||||||
|
|
||||||
// Other built-in functions.
|
// Other built-in functions.
|
||||||
reportMatch(nativeCode, Math.asin.toString());
|
assertNativeFunction(Math.asin);
|
||||||
reportMatch(nativeCode, String.prototype.blink.toString());
|
assertNativeFunction(String.prototype.blink);
|
||||||
reportMatch(nativeCode, RegExp.prototype[Symbol.split].toString());
|
assertNativeFunction(RegExp.prototype[Symbol.split]);
|
||||||
|
|
||||||
// Built-in getter functions.
|
// Built-in getter functions.
|
||||||
reportMatch(nativeCode, Object.getOwnPropertyDescriptor(RegExp.prototype, "flags").get.toString());
|
assertNativeFunction(Object.getOwnPropertyDescriptor(RegExp.prototype, "flags").get);
|
||||||
reportMatch(nativeCode, Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").get.toString());
|
assertNativeFunction(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").get);
|
||||||
|
|
||||||
// Built-in setter functions.
|
// Built-in setter functions.
|
||||||
reportMatch(nativeCode, Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set.toString());
|
assertNativeFunction(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user