We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa886ac commit 1b227bcCopy full SHA for 1b227bc
graal-js/src/com.oracle.truffle.js.test/js/regexp_legacy_features.js
@@ -0,0 +1,18 @@
1
+/*
2
+ * Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
3
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
+ *
5
+ * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6
+ */
7
+
8
+/**
9
+ * Test regexp-legacy-features behavior.
10
11
12
+load("assert.js");
13
14
+class MyRegExp extends RegExp {}
15
16
+// TypeError: RegExp.prototype.compile cannot be used on subclasses of RegExp.
17
+assertThrows(() => new MyRegExp(/foo/).compile('pattern', ''), TypeError);
18
+assertThrows(() => new MyRegExp('foo').compile('pattern', ''), TypeError);
0 commit comments