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

Side by Side Diff: src/v8natives.js

Issue 7811015: Change global const handling to silently ignore redeclarations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 9 years, 3 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return %_CallFunction(receiver, f); 186 return %_CallFunction(receiver, f);
187 } 187 }
188 188
189 189
190 // ---------------------------------------------------------------------------- 190 // ----------------------------------------------------------------------------
191 191
192 // Set up global object. 192 // Set up global object.
193 function SetUpGlobal() { 193 function SetUpGlobal() {
194 %CheckIsBootstrapping(); 194 %CheckIsBootstrapping();
195 // ECMA 262 - 15.1.1.1. 195 // ECMA 262 - 15.1.1.1.
196 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE); 196 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE | READ_ONLY);
197 197
198 // ECMA-262 - 15.1.1.2. 198 // ECMA-262 - 15.1.1.2.
199 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE); 199 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE | READ_ONLY);
200 200
201 // ECMA-262 - 15.1.1.3. 201 // ECMA-262 - 15.1.1.3.
202 %SetProperty(global, "undefined", void 0, DONT_ENUM | DONT_DELETE); 202 %SetProperty(global, "undefined", void 0,
203 DONT_ENUM | DONT_DELETE | READ_ONLY);
203 204
204 // Set up non-enumerable function on the global object. 205 // Set up non-enumerable function on the global object.
205 InstallFunctions(global, DONT_ENUM, $Array( 206 InstallFunctions(global, DONT_ENUM, $Array(
206 "isNaN", GlobalIsNaN, 207 "isNaN", GlobalIsNaN,
207 "isFinite", GlobalIsFinite, 208 "isFinite", GlobalIsFinite,
208 "parseInt", GlobalParseInt, 209 "parseInt", GlobalParseInt,
209 "parseFloat", GlobalParseFloat, 210 "parseFloat", GlobalParseFloat,
210 "eval", GlobalEval 211 "eval", GlobalEval
211 )); 212 ));
212 } 213 }
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 1535
1535 function SetUpFunction() { 1536 function SetUpFunction() {
1536 %CheckIsBootstrapping(); 1537 %CheckIsBootstrapping();
1537 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1538 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1538 "bind", FunctionBind, 1539 "bind", FunctionBind,
1539 "toString", FunctionToString 1540 "toString", FunctionToString
1540 )); 1541 ));
1541 } 1542 }
1542 1543
1543 SetUpFunction(); 1544 SetUpFunction();
OLDNEW
« src/runtime.cc ('K') | « src/runtime.cc ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698