| Index: src/v8natives.js
|
| ===================================================================
|
| --- src/v8natives.js (revision 7143)
|
| +++ src/v8natives.js (working copy)
|
| @@ -251,11 +251,7 @@
|
| if (!IS_FUNCTION(fun)) {
|
| throw new $TypeError('Object.prototype.__defineGetter__: Expecting function');
|
| }
|
| - var desc = new PropertyDescriptor();
|
| - desc.setGet(fun);
|
| - desc.setEnumerable(true);
|
| - desc.setConfigurable(true);
|
| - DefineOwnProperty(ToObject(this), ToString(name), desc, true);
|
| + return %DefineAccessor(ToObject(this), ToString(name), GETTER, fun);
|
| }
|
|
|
|
|
| @@ -275,11 +271,7 @@
|
| throw new $TypeError(
|
| 'Object.prototype.__defineSetter__: Expecting function');
|
| }
|
| - var desc = new PropertyDescriptor();
|
| - desc.setSet(fun);
|
| - desc.setEnumerable(true);
|
| - desc.setConfigurable(true);
|
| - DefineOwnProperty(ToObject(this), ToString(name), desc, true);
|
| + return %DefineAccessor(ToObject(this), ToString(name), SETTER, fun);
|
| }
|
|
|
|
|
| @@ -402,10 +394,6 @@
|
| this.hasSetter_ = false;
|
| }
|
|
|
| -PropertyDescriptor.prototype.__proto__ = null;
|
| -PropertyDescriptor.prototype.toString = function() {
|
| - return "[object PropertyDescriptor]";
|
| -};
|
|
|
| PropertyDescriptor.prototype.setValue = function(value) {
|
| this.value_ = value;
|
| @@ -507,7 +495,7 @@
|
| // property descriptor. For a description of the array layout please
|
| // see the runtime.cc file.
|
| function ConvertDescriptorArrayToDescriptor(desc_array) {
|
| - if (desc_array === false) {
|
| + if (desc_array == false) {
|
| throw 'Internal error: invalid desc_array';
|
| }
|
|
|
| @@ -566,7 +554,7 @@
|
| function DefineOwnProperty(obj, p, desc, should_throw) {
|
| var current_or_access = %GetOwnProperty(ToObject(obj), ToString(p));
|
| // A false value here means that access checks failed.
|
| - if (current_or_access === false) return void 0;
|
| + if (current_or_access == false) return void 0;
|
|
|
| var current = ConvertDescriptorArrayToDescriptor(current_or_access);
|
| var extensible = %IsExtensible(ToObject(obj));
|
|
|