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

Side by Side Diff: test/mjsunit/es6/regexp-flags.js

Issue 1725963002: Version 4.9.385.25 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.9
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/js/regexp.js ('k') | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-regexps --harmony-unicode-regexps 5 // Flags: --harmony-regexps --harmony-unicode-regexps
6 6
7 var r1 = /abc/gi; 7 var r1 = /abc/gi;
8 assertEquals("abc", r1.source); 8 assertEquals("abc", r1.source);
9 assertTrue(r1.global); 9 assertTrue(r1.global);
10 assertTrue(r1.ignoreCase); 10 assertTrue(r1.ignoreCase);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 assertEquals(2, get_count); 43 assertEquals(2, get_count);
44 // Overridden flag getters affects the flags getter. 44 // Overridden flag getters affects the flags getter.
45 assertEquals("gi", r3.flags); 45 assertEquals("gi", r3.flags);
46 assertEquals(4, get_count); 46 assertEquals(4, get_count);
47 // Overridden flag getters do not affect the internal flags. 47 // Overridden flag getters do not affect the internal flags.
48 assertEquals(expected, string.replace(r3, "X")); 48 assertEquals(expected, string.replace(r3, "X"));
49 assertEquals(4, get_count); 49 assertEquals(4, get_count);
50 50
51 51
52 function testName(name) { 52 function testName(name) {
53 if (name === "sticky") { 53 // TODO(littledan): For web compatibility, we don't throw an exception,
54 assertEquals(undefined, RegExp.prototype[name]); 54 // but ES2015 expects an exception to be thrown from this getter.
55 } else { 55 assertEquals(undefined, RegExp.prototype[name]);
56 assertThrows(() => RegExp.prototype[name], TypeError);
57 }
58 assertEquals( 56 assertEquals(
59 "get " + name, 57 "get " + name,
60 Object.getOwnPropertyDescriptor(RegExp.prototype, name).get.name); 58 Object.getOwnPropertyDescriptor(RegExp.prototype, name).get.name);
61 } 59 }
62 60
63 testName("global"); 61 testName("global");
64 testName("ignoreCase"); 62 testName("ignoreCase");
65 testName("multiline"); 63 testName("multiline");
66 testName("source"); 64 testName("source");
67 testName("sticky"); 65 testName("sticky");
68 testName("unicode"); 66 testName("unicode");
OLDNEW
« no previous file with comments | « src/js/regexp.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698