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

Side by Side Diff: src/v8natives.js

Issue 6580056: Make global NaN, Infinity and undefined read only. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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 | test/es5conform/es5conform.status » ('j') | test/es5conform/es5conform.status » ('J')
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 return null; 157 return null;
158 } 158 }
159 159
160 160
161 // ---------------------------------------------------------------------------- 161 // ----------------------------------------------------------------------------
162 162
163 163
164 function SetupGlobal() { 164 function SetupGlobal() {
165 // ECMA 262 - 15.1.1.1. 165 // ECMA 262 - 15.1.1.1.
166 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE); 166 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE | READ_ONLY);
167 167
168 // ECMA-262 - 15.1.1.2. 168 // ECMA-262 - 15.1.1.2.
169 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE); 169 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE | READ_ONLY);
170 170
171 // ECMA-262 - 15.1.1.3. 171 // ECMA-262 - 15.1.1.3.
172 %SetProperty(global, "undefined", void 0, DONT_ENUM | DONT_DELETE); 172 %SetProperty(global, "undefined", void 0,
173 DONT_ENUM | DONT_DELETE | READ_ONLY);
173 174
174 // Setup non-enumerable function on the global object. 175 // Setup non-enumerable function on the global object.
175 InstallFunctions(global, DONT_ENUM, $Array( 176 InstallFunctions(global, DONT_ENUM, $Array(
176 "isNaN", GlobalIsNaN, 177 "isNaN", GlobalIsNaN,
177 "isFinite", GlobalIsFinite, 178 "isFinite", GlobalIsFinite,
178 "parseInt", GlobalParseInt, 179 "parseInt", GlobalParseInt,
179 "parseFloat", GlobalParseFloat, 180 "parseFloat", GlobalParseFloat,
180 "eval", GlobalEval, 181 "eval", GlobalEval,
181 "execScript", GlobalExecScript 182 "execScript", GlobalExecScript
182 )); 183 ));
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 // ---------------------------------------------------------------------------- 1244 // ----------------------------------------------------------------------------
1244 1245
1245 function SetupFunction() { 1246 function SetupFunction() {
1246 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1247 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1247 "bind", FunctionBind, 1248 "bind", FunctionBind,
1248 "toString", FunctionToString 1249 "toString", FunctionToString
1249 )); 1250 ));
1250 } 1251 }
1251 1252
1252 SetupFunction(); 1253 SetupFunction();
OLDNEW
« no previous file with comments | « no previous file | test/es5conform/es5conform.status » ('j') | test/es5conform/es5conform.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698