Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 1d05338016b908586ed59e1e91129bce0a2a4f4c..214fa29428948fb1a2600b8cca1c4a4b76a2f9ae 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -28,7 +28,7 @@ function InstallFunctions(object, attributes, functions) { |
var f = functions[i + 1]; |
%FunctionSetName(f, key); |
%FunctionRemovePrototype(f); |
- %SetProperty(object, key, f, attributes); |
+ %DefineProperty(object, key, f, attributes); |
%SetNativeFlag(f); |
} |
%ToFastProperties(object); |
@@ -65,7 +65,7 @@ function InstallConstants(object, constants) { |
for (var i = 0; i < constants.length; i += 2) { |
var name = constants[i]; |
var k = constants[i + 1]; |
- %SetProperty(object, name, k, attributes); |
+ %DefineProperty(object, name, k, attributes); |
} |
%ToFastProperties(object); |
} |
@@ -86,13 +86,13 @@ function SetUpLockedPrototype(constructor, fields, methods) { |
} |
if (fields) { |
for (var i = 0; i < fields.length; i++) { |
- %SetProperty(prototype, fields[i], UNDEFINED, DONT_ENUM | DONT_DELETE); |
+ %DefineProperty(prototype, fields[i], UNDEFINED, DONT_ENUM | DONT_DELETE); |
} |
} |
for (var i = 0; i < methods.length; i += 2) { |
var key = methods[i]; |
var f = methods[i + 1]; |
- %SetProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); |
+ %DefineProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY); |
%SetNativeFlag(f); |
} |
%SetPrototype(prototype, null); |
@@ -190,13 +190,13 @@ function SetUpGlobal() { |
var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY; |
// ECMA 262 - 15.1.1.1. |
- %SetProperty(global, "NaN", NAN, attributes); |
+ %DefineProperty(global, "NaN", NAN, attributes); |
// ECMA-262 - 15.1.1.2. |
- %SetProperty(global, "Infinity", INFINITY, attributes); |
+ %DefineProperty(global, "Infinity", INFINITY, attributes); |
// ECMA-262 - 15.1.1.3. |
- %SetProperty(global, "undefined", UNDEFINED, attributes); |
+ %DefineProperty(global, "undefined", UNDEFINED, attributes); |
// Set up non-enumerable function on the global object. |
InstallFunctions(global, DONT_ENUM, $Array( |
@@ -1397,7 +1397,7 @@ function SetUpObject() { |
%SetNativeFlag($Object); |
%SetCode($Object, ObjectConstructor); |
- %SetProperty($Object.prototype, "constructor", $Object, DONT_ENUM); |
+ %DefineProperty($Object.prototype, "constructor", $Object, DONT_ENUM); |
// Set up non-enumerable functions on the Object.prototype object. |
InstallFunctions($Object.prototype, DONT_ENUM, $Array( |
@@ -1484,7 +1484,7 @@ function SetUpBoolean () { |
%SetCode($Boolean, BooleanConstructor); |
%FunctionSetPrototype($Boolean, new $Boolean(false)); |
- %SetProperty($Boolean.prototype, "constructor", $Boolean, DONT_ENUM); |
+ %DefineProperty($Boolean.prototype, "constructor", $Boolean, DONT_ENUM); |
InstallFunctions($Boolean.prototype, DONT_ENUM, $Array( |
"toString", BooleanToString, |
@@ -1667,7 +1667,7 @@ function SetUpNumber() { |
%OptimizeObjectForAddingMultipleProperties($Number.prototype, 8); |
// Set up the constructor property on the Number prototype object. |
- %SetProperty($Number.prototype, "constructor", $Number, DONT_ENUM); |
+ %DefineProperty($Number.prototype, "constructor", $Number, DONT_ENUM); |
InstallConstants($Number, $Array( |
// ECMA-262 section 15.7.3.1. |
@@ -1850,7 +1850,7 @@ function SetUpFunction() { |
%CheckIsBootstrapping(); |
%SetCode($Function, FunctionConstructor); |
- %SetProperty($Function.prototype, "constructor", $Function, DONT_ENUM); |
+ %DefineProperty($Function.prototype, "constructor", $Function, DONT_ENUM); |
InstallFunctions($Function.prototype, DONT_ENUM, $Array( |
"bind", FunctionBind, |