1 // |reftest| skip -- legacy-regexp is not supported
2 // Copyright (C) 2020 ExE Boss. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-regexp.prototype.compile
6 description: RegExp.prototype.compile throws a TypeError for cross-realm calls
7 features: [legacy-regexp,cross-realm]
10 const other = $262.createRealm().global;
12 const regexp = new RegExp("");
13 const otherRealm_regexp = new other.RegExp("");
18 RegExp.prototype.compile.call(otherRealm_regexp);
20 "`RegExp.prototype.compile.call(otherRealm_regexp)` throws TypeError"
26 other.RegExp.prototype.compile.call(regexp);
28 "`other.RegExp.prototype.compile.call(regexp)` throws TypeError"
32 otherRealm_regexp.compile(),
34 "`otherRealm_regexp.compile()` is SameValue with `otherRealm_regexp`"