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

Side by Side Diff: src/array.js

Issue 279593004: Harden runtime functions (part 6). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/runtime.h » ('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 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 1462
1463 // Set up non-enumerable constructor property on the Array.prototype 1463 // Set up non-enumerable constructor property on the Array.prototype
1464 // object. 1464 // object.
1465 %SetProperty($Array.prototype, "constructor", $Array, DONT_ENUM); 1465 %SetProperty($Array.prototype, "constructor", $Array, DONT_ENUM);
1466 1466
1467 // Set up non-enumerable functions on the Array object. 1467 // Set up non-enumerable functions on the Array object.
1468 InstallFunctions($Array, DONT_ENUM, $Array( 1468 InstallFunctions($Array, DONT_ENUM, $Array(
1469 "isArray", ArrayIsArray 1469 "isArray", ArrayIsArray
1470 )); 1470 ));
1471 1471
1472 var specialFunctions = %SpecialArrayFunctions({}); 1472 var specialFunctions = %SpecialArrayFunctions();
1473 1473
1474 var getFunction = function(name, jsBuiltin, len) { 1474 var getFunction = function(name, jsBuiltin, len) {
1475 var f = jsBuiltin; 1475 var f = jsBuiltin;
1476 if (specialFunctions.hasOwnProperty(name)) { 1476 if (specialFunctions.hasOwnProperty(name)) {
1477 f = specialFunctions[name]; 1477 f = specialFunctions[name];
1478 } 1478 }
1479 if (!IS_UNDEFINED(len)) { 1479 if (!IS_UNDEFINED(len)) {
1480 %FunctionSetLength(f, len); 1480 %FunctionSetLength(f, len);
1481 } 1481 }
1482 return f; 1482 return f;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 )); 1525 ));
1526 1526
1527 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( 1527 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array(
1528 "join", getFunction("join", ArrayJoin), 1528 "join", getFunction("join", ArrayJoin),
1529 "pop", getFunction("pop", ArrayPop), 1529 "pop", getFunction("pop", ArrayPop),
1530 "push", getFunction("push", ArrayPush) 1530 "push", getFunction("push", ArrayPush)
1531 )); 1531 ));
1532 } 1532 }
1533 1533
1534 SetUpArray(); 1534 SetUpArray();
OLDNEW
« no previous file with comments | « no previous file | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698