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

Unified Diff: src/math.js

Issue 6445: This change removes the %AddProperty native JavaScript function from V8.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/date-delay.js ('k') | src/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/math.js
===================================================================
--- src/math.js (revision 423)
+++ src/math.js (working copy)
@@ -40,7 +40,7 @@
%FunctionSetInstanceClassName(MathConstructor, 'Math');
const $Math = new MathConstructor();
$Math.__proto__ = global.Object.prototype;
-%AddProperty(global, "Math", $Math, DONT_ENUM);
+%SetProperty(global, "Math", $Math, DONT_ENUM);
// ECMA 262 - 15.8.2.1
function MathAbs(x) {
@@ -126,17 +126,41 @@
function SetupMath() {
// Setup math constants.
// ECMA-262, section 15.8.1.1.
- %AddProperty($Math, "E", 2.7182818284590452354, DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "E",
+ 2.7182818284590452354,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
// ECMA-262, section 15.8.1.2.
- %AddProperty($Math, "LN10", 2.302585092994046, DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "LN10",
+ 2.302585092994046,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
// ECMA-262, section 15.8.1.3.
- %AddProperty($Math, "LN2", 0.6931471805599453, DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "LN2",
+ 0.6931471805599453,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
// ECMA-262, section 15.8.1.4.
- %AddProperty($Math, "LOG2E", 1.4426950408889634, DONT_ENUM | DONT_DELETE | READ_ONLY);
- %AddProperty($Math, "LOG10E", 0.43429448190325176, DONT_ENUM | DONT_DELETE | READ_ONLY);
- %AddProperty($Math, "PI", 3.1415926535897932, DONT_ENUM | DONT_DELETE | READ_ONLY);
- %AddProperty($Math, "SQRT1_2", 0.7071067811865476, DONT_ENUM | DONT_DELETE | READ_ONLY);
- %AddProperty($Math, "SQRT2", 1.4142135623730951, DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "LOG2E",
+ 1.4426950408889634,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "LOG10E",
+ 0.43429448190325176,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "PI",
+ 3.1415926535897932,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "SQRT1_2",
+ 0.7071067811865476,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %SetProperty($Math,
+ "SQRT2",
+ 1.4142135623730951,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
// Setup non-enumerable functions of the Math object and
// set their names.
« no previous file with comments | « src/date-delay.js ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698