From a8be726b4310616e53767417134448d137380d6e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 3 Sep 2021 19:22:55 -0400 Subject: [PATCH] Remove TCO tests invalidated by normative change Normative: Define default constructors using spec steps https://github.com/tc39/ecma262/pull/2216 Resolves https://github.com/tc39/test262/issues/2978 --- .../call/tco-cross-realm-class-construct.js | 39 ------------------- ...tco-cross-realm-class-derived-construct.js | 39 ------------------- .../call/tco-cross-realm-fun-call.js | 38 ------------------ .../call/tco-cross-realm-fun-construct.js | 38 ------------------ 4 files changed, 154 deletions(-) delete mode 100644 test/language/expressions/call/tco-cross-realm-class-construct.js delete mode 100644 test/language/expressions/call/tco-cross-realm-class-derived-construct.js delete mode 100644 test/language/expressions/call/tco-cross-realm-fun-call.js delete mode 100644 test/language/expressions/call/tco-cross-realm-fun-construct.js diff --git a/test/language/expressions/call/tco-cross-realm-class-construct.js b/test/language/expressions/call/tco-cross-realm-class-construct.js deleted file mode 100644 index 89ea817ecf8..00000000000 --- a/test/language/expressions/call/tco-cross-realm-class-construct.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-function-calls-runtime-semantics-evaluation -description: > - Check TypeError is thrown from correct realm with tco-call to class constructor from derived - class [[Construct]] invocation. -info: | - 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, tailPosition ) - ... - 4. If tailPosition is true, perform PrepareForTailCall(). - 5. Let result be Call(func, thisValue, argList). - 6. Assert: If tailPosition is true, the above call will not return here, but instead evaluation will continue as if the following return has already occurred. - 7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type. - 8. Return result. - - 9.2.1 [[Call]] ( thisArgument, argumentsList) - ... - 2. If F.[[FunctionKind]] is "classConstructor", throw a TypeError exception. - 3. Let callerContext be the running execution context. - 4. Let calleeContext be PrepareForOrdinaryCall(F, undefined). - 5. Assert: calleeContext is now the running execution context. - ... - -features: [tail-call-optimization, class, cross-realm] ----*/ - -// - The class constructor call is in a valid tail-call position, which means PrepareForTailCall is performed. -// - The function call returns from `otherRealm` and proceeds the tail-call in this realm. -// - Calling the class constructor throws a TypeError from the current realm, that means this realm and not `otherRealm`. -var code = "(class { constructor() { return (class {})(); } });"; - -var otherRealm = $262.createRealm(); -var tco = otherRealm.evalScript(code); - -assert.throws(TypeError, function() { - new tco(); -}); diff --git a/test/language/expressions/call/tco-cross-realm-class-derived-construct.js b/test/language/expressions/call/tco-cross-realm-class-derived-construct.js deleted file mode 100644 index 1dfa7b4291a..00000000000 --- a/test/language/expressions/call/tco-cross-realm-class-derived-construct.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-function-calls-runtime-semantics-evaluation -description: > - Check TypeError is thrown from correct realm with tco-call to class constructor from - class [[Construct]] invocation. -info: | - 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, tailPosition ) - ... - 4. If tailPosition is true, perform PrepareForTailCall(). - 5. Let result be Call(func, thisValue, argList). - 6. Assert: If tailPosition is true, the above call will not return here, but instead evaluation will continue as if the following return has already occurred. - 7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type. - 8. Return result. - - 9.2.1 [[Call]] ( thisArgument, argumentsList) - ... - 2. If F.[[FunctionKind]] is "classConstructor", throw a TypeError exception. - 3. Let callerContext be the running execution context. - 4. Let calleeContext be PrepareForOrdinaryCall(F, undefined). - 5. Assert: calleeContext is now the running execution context. - ... - -features: [tail-call-optimization, class, cross-realm] ----*/ - -// - The class constructor call is in a valid tail-call position, which means PrepareForTailCall is performed. -// - The function call returns from `otherRealm` and proceeds the tail-call in this realm. -// - Calling the class constructor throws a TypeError from the current realm, that means this realm and not `otherRealm`. -var code = "(class extends Object { constructor() { return (class {})(); } });"; - -var otherRealm = $262.createRealm(); -var tco = otherRealm.evalScript(code); - -assert.throws(TypeError, function() { - new tco(); -}); diff --git a/test/language/expressions/call/tco-cross-realm-fun-call.js b/test/language/expressions/call/tco-cross-realm-fun-call.js deleted file mode 100644 index 9f5a611e91a..00000000000 --- a/test/language/expressions/call/tco-cross-realm-fun-call.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2017 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-function-calls-runtime-semantics-evaluation -description: > - Check TypeError is thrown from correct realm with tco-call to class constructor from [[Call]] invocation. -info: | - 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, tailPosition ) - ... - 4. If tailPosition is true, perform PrepareForTailCall(). - 5. Let result be Call(func, thisValue, argList). - 6. Assert: If tailPosition is true, the above call will not return here, but instead evaluation will continue as if the following return has already occurred. - 7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type. - 8. Return result. - - 9.2.1 [[Call]] ( thisArgument, argumentsList) - ... - 2. If F.[[FunctionKind]] is "classConstructor", throw a TypeError exception. - 3. Let callerContext be the running execution context. - 4. Let calleeContext be PrepareForOrdinaryCall(F, undefined). - 5. Assert: calleeContext is now the running execution context. - ... - -features: [tail-call-optimization, class, cross-realm] ----*/ - -// - The class constructor call is in a valid tail-call position, which means PrepareForTailCall is performed. -// - The function call returns from `otherRealm` and proceeds the tail-call in this realm. -// - Calling the class constructor throws a TypeError from the current realm, that means this realm and not `otherRealm`. -var code = "'use strict'; (function() { return (class {})(); });"; - -var otherRealm = $262.createRealm(); -var tco = otherRealm.evalScript(code); - -assert.throws(TypeError, function() { - tco(); -}); diff --git a/test/language/expressions/call/tco-cross-realm-fun-construct.js b/test/language/expressions/call/tco-cross-realm-fun-construct.js deleted file mode 100644 index 11c2a582f1e..00000000000 --- a/test/language/expressions/call/tco-cross-realm-fun-construct.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2017 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-function-calls-runtime-semantics-evaluation -description: > - Check TypeError is thrown from correct realm with tco-call to class constructor from [[Construct]] invocation. -info: | - 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, tailPosition ) - ... - 4. If tailPosition is true, perform PrepareForTailCall(). - 5. Let result be Call(func, thisValue, argList). - 6. Assert: If tailPosition is true, the above call will not return here, but instead evaluation will continue as if the following return has already occurred. - 7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type. - 8. Return result. - - 9.2.1 [[Call]] ( thisArgument, argumentsList) - ... - 2. If F.[[FunctionKind]] is "classConstructor", throw a TypeError exception. - 3. Let callerContext be the running execution context. - 4. Let calleeContext be PrepareForOrdinaryCall(F, undefined). - 5. Assert: calleeContext is now the running execution context. - ... - -features: [tail-call-optimization, class, cross-realm] ----*/ - -// - The class constructor call is in a valid tail-call position, which means PrepareForTailCall is performed. -// - The function call returns from `otherRealm` and proceeds the tail-call in this realm. -// - Calling the class constructor throws a TypeError from the current realm, that means this realm and not `otherRealm`. -var code = "'use strict'; (function() { return (class {})(); });"; - -var otherRealm = $262.createRealm(); -var tco = otherRealm.evalScript(code); - -assert.throws(TypeError, function() { - new tco(); -});