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

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

Issue 2113593002: Revert of Amend DataView, ArrayBuffer, and TypedArray methods to use ToIndex. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed revert Created 4 years, 5 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/builtins.cc ('k') | src/js/typedarray.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 // This files contains runtime support implemented in JavaScript. 5 // This files contains runtime support implemented in JavaScript.
6 6
7 // CAUTION: Some of the functions specified in this file are called 7 // CAUTION: Some of the functions specified in this file are called
8 // directly from compiled code. These are the functions with names in 8 // directly from compiled code. These are the functions with names in
9 // ALL CAPS. The compiled code passes the first argument in 'this'. 9 // ALL CAPS. The compiled code passes the first argument in 'this'.
10 10
(...skipping 27 matching lines...) Expand all
38 */ 38 */
39 39
40 40
41 function ToPositiveInteger(x, rangeErrorIndex) { 41 function ToPositiveInteger(x, rangeErrorIndex) {
42 var i = TO_INTEGER(x) + 0; 42 var i = TO_INTEGER(x) + 0;
43 if (i < 0) throw MakeRangeError(rangeErrorIndex); 43 if (i < 0) throw MakeRangeError(rangeErrorIndex);
44 return i; 44 return i;
45 } 45 }
46 46
47 47
48 function ToIndex(x, rangeErrorIndex) {
49 var i = TO_INTEGER(x) + 0;
50 if (i < 0 || i > kMaxSafeInteger) throw MakeRangeError(rangeErrorIndex);
51 return i;
52 }
53
54
55 function MaxSimple(a, b) { 48 function MaxSimple(a, b) {
56 return a > b ? a : b; 49 return a > b ? a : b;
57 } 50 }
58 51
59 52
60 function MinSimple(a, b) { 53 function MinSimple(a, b) {
61 return a > b ? b : a; 54 return a > b ? b : a;
62 } 55 }
63 56
64 57
(...skipping 29 matching lines...) Expand all
94 // boilerplate gets the right prototype. 87 // boilerplate gets the right prototype.
95 %FunctionSetPrototype(GlobalArray, new GlobalArray(0)); 88 %FunctionSetPrototype(GlobalArray, new GlobalArray(0));
96 89
97 // ---------------------------------------------------------------------------- 90 // ----------------------------------------------------------------------------
98 // Exports 91 // Exports
99 92
100 utils.Export(function(to) { 93 utils.Export(function(to) {
101 to.MaxSimple = MaxSimple; 94 to.MaxSimple = MaxSimple;
102 to.MinSimple = MinSimple; 95 to.MinSimple = MinSimple;
103 to.ToPositiveInteger = ToPositiveInteger; 96 to.ToPositiveInteger = ToPositiveInteger;
104 to.ToIndex = ToIndex;
105 to.SpeciesConstructor = SpeciesConstructor; 97 to.SpeciesConstructor = SpeciesConstructor;
106 }); 98 });
107 99
108 }) 100 })
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/js/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698