Index: src/messages.js |
diff --git a/src/messages.js b/src/messages.js |
index 859bc0d721cd84bd9ba5bdd86b011b06d59dff8b..3446402ff9506037dc496589a6115aa46816806a 100644 |
--- a/src/messages.js |
+++ b/src/messages.js |
@@ -282,8 +282,8 @@ function MakeGenericError(constructor, type, args) { |
* Set up the Script function and constructor. |
*/ |
%FunctionSetInstanceClassName(Script, 'Script'); |
-%SetProperty(Script.prototype, 'constructor', Script, |
- DONT_ENUM | DONT_DELETE | READ_ONLY); |
+%DefineProperty(Script.prototype, 'constructor', Script, |
+ DONT_ENUM | DONT_DELETE | READ_ONLY); |
%SetCode(Script, function(x) { |
// Script objects can only be created by the VM. |
throw new $Error("Not supported"); |
@@ -1181,8 +1181,9 @@ function SetUpError() { |
// effects when overwriting the error functions from |
// user code. |
var name = f.name; |
- %SetProperty(global, name, f, DONT_ENUM); |
- %SetProperty(builtins, '$' + name, f, DONT_ENUM | DONT_DELETE | READ_ONLY); |
+ %DefineProperty(global, name, f, DONT_ENUM); |
+ %DefineProperty(builtins, '$' + name, f, |
+ DONT_ENUM | DONT_DELETE | READ_ONLY); |
// Configure the error function. |
if (name == 'Error') { |
// The prototype of the Error object must itself be an error. |
@@ -1197,8 +1198,8 @@ function SetUpError() { |
%FunctionSetPrototype(f, new $Error()); |
} |
%FunctionSetInstanceClassName(f, 'Error'); |
- %SetProperty(f.prototype, 'constructor', f, DONT_ENUM); |
- %SetProperty(f.prototype, "name", name, DONT_ENUM); |
+ %DefineProperty(f.prototype, 'constructor', f, DONT_ENUM); |
+ %DefineProperty(f.prototype, "name", name, DONT_ENUM); |
%SetCode(f, function(m) { |
if (%_IsConstructCall()) { |
// Define all the expected properties directly on the error |
@@ -1230,7 +1231,7 @@ SetUpError(); |
$Error.captureStackTrace = captureStackTrace; |
-%SetProperty($Error.prototype, 'message', '', DONT_ENUM); |
+%DefineProperty($Error.prototype, 'message', '', DONT_ENUM); |
// Global list of error objects visited during ErrorToString. This is |
// used to detect cycles in error toString formatting. |