| Index: src/messages.js
|
| ===================================================================
|
| --- src/messages.js (revision 8618)
|
| +++ src/messages.js (working copy)
|
| @@ -148,6 +148,7 @@
|
| unexpected_token_number: ["Unexpected number"],
|
| unexpected_token_string: ["Unexpected string"],
|
| unexpected_token_identifier: ["Unexpected identifier"],
|
| + unexpected_reserved: ["Unexpected reserved word"],
|
| unexpected_strict_reserved: ["Unexpected strict mode reserved word"],
|
| unexpected_eos: ["Unexpected end of input"],
|
| malformed_regexp: ["Invalid regular expression: /", "%0", "/: ", "%1"],
|
| @@ -190,9 +191,14 @@
|
| proto_object_or_null: ["Object prototype may only be an Object or null"],
|
| property_desc_object: ["Property description must be an object: ", "%0"],
|
| redefine_disallowed: ["Cannot redefine property: ", "%0"],
|
| - define_disallowed: ["Cannot define property, object is not extensible: ", "%0"],
|
| + define_disallowed: ["Cannot define property:", "%0", ", object is not extensible."],
|
| non_extensible_proto: ["%0", " is not extensible"],
|
| + handler_non_object: ["Proxy.", "%0", " called with non-object as handler"],
|
| handler_trap_missing: ["Proxy handler ", "%0", " has no '", "%1", "' trap"],
|
| + handler_failed: ["Proxy handler ", "%0", " returned false for '", "%1", "' trap"],
|
| + proxy_prop_not_configurable: ["Trap ", "%1", " of proxy handler ", "%0", " returned non-configurable descriptor for property ", "%2"],
|
| + proxy_non_object_prop_names: ["Trap ", "%1", " returned non-object ", "%0"],
|
| + proxy_repeated_prop_name: ["Trap ", "%1", " returned repeated property name ", "%2"],
|
| // RangeError
|
| invalid_array_length: ["Invalid array length"],
|
| stack_overflow: ["Maximum call stack size exceeded"],
|
| @@ -215,6 +221,7 @@
|
| invalid_preparser_data: ["Invalid preparser data for function ", "%0"],
|
| strict_mode_with: ["Strict mode code may not include a with statement"],
|
| strict_catch_variable: ["Catch variable may not be eval or arguments in strict mode"],
|
| + too_many_arguments: ["Too many arguments in function call (only 32766 allowed)"],
|
| too_many_parameters: ["Too many parameters in function definition (only 32766 allowed)"],
|
| too_many_variables: ["Too many variables declared (only 32767 allowed)"],
|
| strict_param_name: ["Parameter name eval or arguments is not allowed in strict mode"],
|
| @@ -679,18 +686,24 @@
|
| // can't rely on 'this' being the same as 'obj'.
|
| var hasBeenSet = false;
|
| var value;
|
| - obj.__defineGetter__(name, function () {
|
| + function getter() {
|
| if (hasBeenSet) {
|
| return value;
|
| }
|
| hasBeenSet = true;
|
| value = fun(obj);
|
| return value;
|
| - });
|
| - obj.__defineSetter__(name, function (v) {
|
| + }
|
| + function setter(v) {
|
| hasBeenSet = true;
|
| value = v;
|
| - });
|
| + }
|
| + var desc = { get: getter,
|
| + set: setter,
|
| + enumerable: false,
|
| + configurable: true };
|
| + desc = ToPropertyDescriptor(desc);
|
| + DefineOwnProperty(obj, name, desc, true);
|
| }
|
|
|
| function CallSite(receiver, fun, pos) {
|
| @@ -994,15 +1007,15 @@
|
| // overwriting allows leaks of error objects between script blocks
|
| // in the same context in a browser setting. Therefore we fix the
|
| // name.
|
| - %SetProperty(f.prototype, "name", name, READ_ONLY | DONT_DELETE);
|
| + %SetProperty(f.prototype, "name", name, DONT_ENUM | DONT_DELETE | READ_ONLY);
|
| %SetCode(f, function(m) {
|
| if (%_IsConstructCall()) {
|
| // Define all the expected properties directly on the error
|
| // object. This avoids going through getters and setters defined
|
| // on prototype objects.
|
| - %IgnoreAttributesAndSetProperty(this, 'stack', void 0);
|
| - %IgnoreAttributesAndSetProperty(this, 'arguments', void 0);
|
| - %IgnoreAttributesAndSetProperty(this, 'type', void 0);
|
| + %IgnoreAttributesAndSetProperty(this, 'stack', void 0, DONT_ENUM);
|
| + %IgnoreAttributesAndSetProperty(this, 'arguments', void 0, DONT_ENUM);
|
| + %IgnoreAttributesAndSetProperty(this, 'type', void 0, DONT_ENUM);
|
| if (m === kAddMessageAccessorsMarker) {
|
| // DefineOneShotAccessor always inserts a message property and
|
| // ignores setters.
|
| @@ -1010,7 +1023,10 @@
|
| return FormatMessage(%NewMessageObject(obj.type, obj.arguments));
|
| });
|
| } else if (!IS_UNDEFINED(m)) {
|
| - %IgnoreAttributesAndSetProperty(this, 'message', ToString(m));
|
| + %IgnoreAttributesAndSetProperty(this,
|
| + 'message',
|
| + ToString(m),
|
| + DONT_ENUM);
|
| }
|
| captureStackTrace(this, f);
|
| } else {
|
| @@ -1045,8 +1061,20 @@
|
| $Error.captureStackTrace = captureStackTrace;
|
|
|
| // Setup extra properties of the Error.prototype object.
|
| -$Error.prototype.message = '';
|
| +function setErrorMessage() {
|
| + var desc = {value: '',
|
| + enumerable: false,
|
| + configurable: true,
|
| + writable: true };
|
| + DefineOwnProperty($Error.prototype,
|
| + 'message',
|
| + ToPropertyDescriptor(desc),
|
| + true);
|
|
|
| +}
|
| +
|
| +setErrorMessage();
|
| +
|
| // Global list of error objects visited during errorToString. This is
|
| // used to detect cycles in error toString formatting.
|
| var visited_errors = new $Array();
|
|
|