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

Side by Side Diff: src/array.js

Issue 835753002: Implement ES6 Array.prototype.toString behind --harmony-tostring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Simplify CL Created 5 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 | « no previous file | src/harmony-tostring.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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declarations have been made 7 // This file relies on the fact that the following declarations have been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 10
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 func = this.join; 354 func = this.join;
355 if (func === ArrayJoin) { 355 if (func === ArrayJoin) {
356 return Join(this, this.length, ',', ConvertToString); 356 return Join(this, this.length, ',', ConvertToString);
357 } 357 }
358 array = this; 358 array = this;
359 } else { 359 } else {
360 array = ToObject(this); 360 array = ToObject(this);
361 func = array.join; 361 func = array.join;
362 } 362 }
363 if (!IS_SPEC_FUNCTION(func)) { 363 if (!IS_SPEC_FUNCTION(func)) {
364 return %_CallFunction(array, NoSideEffectsObjectToString); 364 return %_CallFunction(array, DefaultObjectToString);
365 } 365 }
366 return %_CallFunction(array, func); 366 return %_CallFunction(array, func);
367 } 367 }
368 368
369 369
370 function ArrayToLocaleString() { 370 function ArrayToLocaleString() {
371 var array = ToObject(this); 371 var array = ToObject(this);
372 var arrayLen = array.length; 372 var arrayLen = array.length;
373 var len = TO_UINT32(arrayLen); 373 var len = TO_UINT32(arrayLen);
374 if (len === 0) return ""; 374 if (len === 0) return "";
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 )); 1581 ));
1582 1582
1583 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( 1583 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array(
1584 "join", getFunction("join", ArrayJoin), 1584 "join", getFunction("join", ArrayJoin),
1585 "pop", getFunction("pop", ArrayPop), 1585 "pop", getFunction("pop", ArrayPop),
1586 "push", getFunction("push", ArrayPush) 1586 "push", getFunction("push", ArrayPush)
1587 )); 1587 ));
1588 } 1588 }
1589 1589
1590 SetUpArray(); 1590 SetUpArray();
OLDNEW
« no previous file with comments | « no previous file | src/harmony-tostring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698