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

Side by Side Diff: src/js/regexp.js

Issue 1470193002: Array/TypedArray/ArrayBuffer method subclassing and @@species (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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/arraybuffer.js ('k') | src/js/runtime.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 294
295 295
296 // ES6 21.2.5.11. 296 // ES6 21.2.5.11.
297 function RegExpSplit(string, limit) { 297 function RegExpSplit(string, limit) {
298 // TODO(yangguo): allow non-regexp receivers. 298 // TODO(yangguo): allow non-regexp receivers.
299 if (!IS_REGEXP(this)) { 299 if (!IS_REGEXP(this)) {
300 throw MakeTypeError(kIncompatibleMethodReceiver, 300 throw MakeTypeError(kIncompatibleMethodReceiver,
301 "RegExp.prototype.@@split", this); 301 "RegExp.prototype.@@split", this);
302 } 302 }
303
304 // TODO(yangguo): Clone the RegExp using SpeciesConstructor
305 // to change the flags to turn 'y' on.
306
303 var separator = this; 307 var separator = this;
304 var subject = TO_STRING(string); 308 var subject = TO_STRING(string);
305 309
306 limit = (IS_UNDEFINED(limit)) ? kMaxUint32 : TO_UINT32(limit); 310 limit = (IS_UNDEFINED(limit)) ? kMaxUint32 : TO_UINT32(limit);
307 var length = subject.length; 311 var length = subject.length;
308 312
309 if (limit === 0) return []; 313 if (limit === 0) return [];
310 314
311 if (length === 0) { 315 if (length === 0) {
312 if (DoRegExpExec(separator, subject, 0, 0) !== null) return []; 316 if (DoRegExpExec(separator, subject, 0, 0) !== null) return [];
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // Exports 576 // Exports
573 577
574 utils.Export(function(to) { 578 utils.Export(function(to) {
575 to.RegExpExec = DoRegExpExec; 579 to.RegExpExec = DoRegExpExec;
576 to.RegExpExecNoTests = RegExpExecNoTests; 580 to.RegExpExecNoTests = RegExpExecNoTests;
577 to.RegExpLastMatchInfo = RegExpLastMatchInfo; 581 to.RegExpLastMatchInfo = RegExpLastMatchInfo;
578 to.RegExpTest = RegExpTest; 582 to.RegExpTest = RegExpTest;
579 }); 583 });
580 584
581 }) 585 })
OLDNEW
« no previous file with comments | « src/js/arraybuffer.js ('k') | src/js/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698