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

Side by Side Diff: src/v8natives.js

Issue 7058006: Merge removal of execScript to 3.2 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.2/
Patch Set: Created 9 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/version.cc » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 'be the global object from which eval originated'); 140 'be the global object from which eval originated');
141 } 141 }
142 142
143 var f = %CompileString(x); 143 var f = %CompileString(x);
144 if (!IS_FUNCTION(f)) return f; 144 if (!IS_FUNCTION(f)) return f;
145 145
146 return %_CallFunction(this, f); 146 return %_CallFunction(this, f);
147 } 147 }
148 148
149 149
150 // execScript for IE compatibility.
151 function GlobalExecScript(expr, lang) {
152 // NOTE: We don't care about the character casing.
153 if (!lang || /javascript/i.test(lang)) {
154 var f = %CompileString(ToString(expr));
155 %_CallFunction(%GlobalReceiver(global), f);
156 }
157 return null;
158 }
159
160
161 // ---------------------------------------------------------------------------- 150 // ----------------------------------------------------------------------------
162 151
163 152
164 function SetupGlobal() { 153 function SetupGlobal() {
165 // ECMA 262 - 15.1.1.1. 154 // ECMA 262 - 15.1.1.1.
166 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE); 155 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE);
167 156
168 // ECMA-262 - 15.1.1.2. 157 // ECMA-262 - 15.1.1.2.
169 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE); 158 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE);
170 159
171 // ECMA-262 - 15.1.1.3. 160 // ECMA-262 - 15.1.1.3.
172 %SetProperty(global, "undefined", void 0, DONT_ENUM | DONT_DELETE); 161 %SetProperty(global, "undefined", void 0, DONT_ENUM | DONT_DELETE);
173 162
174 // Setup non-enumerable function on the global object. 163 // Setup non-enumerable function on the global object.
175 InstallFunctions(global, DONT_ENUM, $Array( 164 InstallFunctions(global, DONT_ENUM, $Array(
176 "isNaN", GlobalIsNaN, 165 "isNaN", GlobalIsNaN,
177 "isFinite", GlobalIsFinite, 166 "isFinite", GlobalIsFinite,
178 "parseInt", GlobalParseInt, 167 "parseInt", GlobalParseInt,
179 "parseFloat", GlobalParseFloat, 168 "parseFloat", GlobalParseFloat,
180 "eval", GlobalEval, 169 "eval", GlobalEval
181 "execScript", GlobalExecScript
182 )); 170 ));
183 } 171 }
184 172
185 SetupGlobal(); 173 SetupGlobal();
186 174
187 175
188 // ---------------------------------------------------------------------------- 176 // ----------------------------------------------------------------------------
189 // Boolean (first part of definition) 177 // Boolean (first part of definition)
190 178
191 179
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 // ---------------------------------------------------------------------------- 1272 // ----------------------------------------------------------------------------
1285 1273
1286 function SetupFunction() { 1274 function SetupFunction() {
1287 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1275 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1288 "bind", FunctionBind, 1276 "bind", FunctionBind,
1289 "toString", FunctionToString 1277 "toString", FunctionToString
1290 )); 1278 ));
1291 } 1279 }
1292 1280
1293 SetupFunction(); 1281 SetupFunction();
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698