Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: test/mjsunit/es6/regexp-constructor.js

Issue 1846303002: Further ES2015 RegExp spec compliance fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix cctest Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/classes-subclass-builtins.js ('k') | test/mjsunit/es6/regexp-flags.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/regexp-constructor.js
diff --git a/test/mjsunit/es6/regexp-constructor.js b/test/mjsunit/es6/regexp-constructor.js
index e3b7efa0e7a382390fe7f1971422ace491552ead..559ac00cd08c8a4f45210519fc9a1160960e99bb 100644
--- a/test/mjsunit/es6/regexp-constructor.js
+++ b/test/mjsunit/es6/regexp-constructor.js
@@ -21,32 +21,47 @@ function should_not_be_called() {
})();
(function() {
+ let allow = false;
class A extends RegExp {
- get source() { throw new Error("should not be called") }
- get flags() { throw new Error("should not be called") }
+ get source() {
+ if (!allow) throw new Error("should not be called");
+ return super.source;
+ }
+ get flags() {
+ if (!allow) throw new Error("should not be called");
+ return super.flags
+ }
}
var r = new A("biep");
var r2 = RegExp(r);
assertFalse(r === r2);
+ allow = true;
assertEquals(r, r2);
+ allow = false;
assertTrue(A.prototype === r.__proto__);
assertTrue(RegExp.prototype === r2.__proto__);
var r3 = RegExp(r);
assertFalse(r3 === r);
+ allow = true;
assertEquals(r3, r);
+ allow = false;
var r4 = new A(r2);
assertFalse(r4 === r2);
+ allow = true;
assertEquals(r4, r2);
+ allow = false;
assertTrue(A.prototype === r4.__proto__);
r[Symbol.match] = false;
var r5 = new A(r);
assertFalse(r5 === r);
+ allow = true;
assertEquals(r5, r);
+ allow = false;
assertTrue(A.prototype === r5.__proto__);
})();
« no previous file with comments | « test/mjsunit/es6/classes-subclass-builtins.js ('k') | test/mjsunit/es6/regexp-flags.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698