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

Side by Side Diff: src/v8natives.js

Issue 7538016: Make window.{undefined,NaN,Infinity} read-only (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 return %_CallFunction(receiver, f); 156 return %_CallFunction(receiver, f);
157 } 157 }
158 158
159 159
160 // ---------------------------------------------------------------------------- 160 // ----------------------------------------------------------------------------
161 161
162 162
163 function SetupGlobal() { 163 function SetupGlobal() {
164 // ECMA 262 - 15.1.1.1. 164 // ECMA 262 - 15.1.1.1.
165 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE); 165 %SetProperty(global, "NaN", $NaN, DONT_ENUM | DONT_DELETE | READ_ONLY);
166 166
167 // ECMA-262 - 15.1.1.2. 167 // ECMA-262 - 15.1.1.2.
168 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE); 168 %SetProperty(global, "Infinity", 1/0, DONT_ENUM | DONT_DELETE | READ_ONLY);
169 169
170 // ECMA-262 - 15.1.1.3. 170 // ECMA-262 - 15.1.1.3.
171 %SetProperty(global, "undefined", void 0, DONT_ENUM | DONT_DELETE); 171 %SetProperty(global, "undefined", void 0,
172 DONT_ENUM | DONT_DELETE | READ_ONLY);
172 173
173 // Setup non-enumerable function on the global object. 174 // Setup non-enumerable function on the global object.
174 InstallFunctions(global, DONT_ENUM, $Array( 175 InstallFunctions(global, DONT_ENUM, $Array(
175 "isNaN", GlobalIsNaN, 176 "isNaN", GlobalIsNaN,
176 "isFinite", GlobalIsFinite, 177 "isFinite", GlobalIsFinite,
177 "parseInt", GlobalParseInt, 178 "parseInt", GlobalParseInt,
178 "parseFloat", GlobalParseFloat, 179 "parseFloat", GlobalParseFloat,
179 "eval", GlobalEval 180 "eval", GlobalEval
180 )); 181 ));
181 } 182 }
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 // ---------------------------------------------------------------------------- 1533 // ----------------------------------------------------------------------------
1533 1534
1534 function SetupFunction() { 1535 function SetupFunction() {
1535 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1536 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1536 "bind", FunctionBind, 1537 "bind", FunctionBind,
1537 "toString", FunctionToString 1538 "toString", FunctionToString
1538 )); 1539 ));
1539 } 1540 }
1540 1541
1541 SetupFunction(); 1542 SetupFunction();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-decls.cc » ('j') | test/mjsunit/undeletable-functions.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698