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

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

Issue 1577703005: [runtime] Refactor Function object setup into a single place. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/bootstrapper.cc ('k') | no next file » | 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
11 11
12 var GlobalArray = global.Array; 12 var GlobalArray = global.Array;
13 var GlobalBoolean = global.Boolean; 13 var GlobalBoolean = global.Boolean;
14 var GlobalFunction = global.Function;
15 var GlobalNumber = global.Number; 14 var GlobalNumber = global.Number;
16 var GlobalObject = global.Object; 15 var GlobalObject = global.Object;
17 var InternalArray = utils.InternalArray; 16 var InternalArray = utils.InternalArray;
18 var iteratorSymbol = utils.ImportNow("iterator_symbol"); 17 var iteratorSymbol = utils.ImportNow("iterator_symbol");
19 var MakeRangeError; 18 var MakeRangeError;
20 var MakeSyntaxError; 19 var MakeSyntaxError;
21 var MakeTypeError; 20 var MakeTypeError;
22 var MathAbs; 21 var MathAbs;
23 var NaN = %GetRootNaN(); 22 var NaN = %GetRootNaN();
24 var ObjectToString = utils.ImportNow("object_to_string"); 23 var ObjectToString = utils.ImportNow("object_to_string");
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 "isNaN", NumberIsNaN, 1158 "isNaN", NumberIsNaN,
1160 "isSafeInteger", NumberIsSafeInteger, 1159 "isSafeInteger", NumberIsSafeInteger,
1161 "parseInt", GlobalParseInt, 1160 "parseInt", GlobalParseInt,
1162 "parseFloat", GlobalParseFloat 1161 "parseFloat", GlobalParseFloat
1163 ]); 1162 ]);
1164 1163
1165 %SetForceInlineFlag(NumberIsNaN); 1164 %SetForceInlineFlag(NumberIsNaN);
1166 1165
1167 1166
1168 // ---------------------------------------------------------------------------- 1167 // ----------------------------------------------------------------------------
1169 // Function
1170
1171 // ----------------------------------------------------------------------------
1172
1173 %AddNamedProperty(GlobalFunction.prototype, "constructor", GlobalFunction,
1174 DONT_ENUM);
1175
1176 // ----------------------------------------------------------------------------
1177 // Iterator related spec functions. 1168 // Iterator related spec functions.
1178 1169
1179 // ES6 7.4.1 GetIterator(obj, method) 1170 // ES6 7.4.1 GetIterator(obj, method)
1180 function GetIterator(obj, method) { 1171 function GetIterator(obj, method) {
1181 if (IS_UNDEFINED(method)) { 1172 if (IS_UNDEFINED(method)) {
1182 method = obj[iteratorSymbol]; 1173 method = obj[iteratorSymbol];
1183 } 1174 }
1184 if (!IS_CALLABLE(method)) { 1175 if (!IS_CALLABLE(method)) {
1185 throw MakeTypeError(kNotIterable, obj); 1176 throw MakeTypeError(kNotIterable, obj);
1186 } 1177 }
(...skipping 16 matching lines...) Expand all
1203 to.ObjectDefineProperties = ObjectDefineProperties; 1194 to.ObjectDefineProperties = ObjectDefineProperties;
1204 to.ObjectDefineProperty = ObjectDefineProperty; 1195 to.ObjectDefineProperty = ObjectDefineProperty;
1205 to.ObjectHasOwnProperty = ObjectHasOwnProperty; 1196 to.ObjectHasOwnProperty = ObjectHasOwnProperty;
1206 }); 1197 });
1207 1198
1208 %InstallToContext([ 1199 %InstallToContext([
1209 "object_value_of", ObjectValueOf, 1200 "object_value_of", ObjectValueOf,
1210 ]); 1201 ]);
1211 1202
1212 }) 1203 })
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698