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

Unified Diff: frog/corejs.dart

Issue 9214005: Get Firefox and IE working again with Object.defineProperty! (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | « client/tests/client/client.status ('k') | frog/gen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/corejs.dart
===================================================================
--- frog/corejs.dart (revision 3300)
+++ frog/corejs.dart (working copy)
@@ -160,7 +160,7 @@
// here.
w.writeln('Object.defineProperty(Object.prototype, "get\$typeName", ' +
'{ value: Object.prototype.\$typeNameOf, enumerable: false, ' +
- 'configurable: true});');
+ 'writable: true, configurable: true});');
}
}
}
@@ -187,8 +187,8 @@
}
// TODO(jimhug): Should this or should it not match equals?
Object.defineProperty(Object.prototype, '$eq', { value: function(other) {
- return this === other;
-}, enumerable: false, configurable: true });""";
+ return this === other;
+}, enumerable: false, writable: true, configurable: true });""";
/** Snippet for `$bit_not`. */
final String _BIT_NOT_FUNCTION = @"""
@@ -279,19 +279,18 @@
}
}
method = method || methods.Object;
- // Patch the prototype, but don't overwrite an existing stub, like
- // the one on Object.prototype.
var proto = Object.getPrototypeOf(obj);
if (!proto.hasOwnProperty(name)) {
- Object.defineProperty(proto, name,
- { value: method, enumerable: false, configurable: true });
+ Object.defineProperty(proto, name,
+ { value: method, enumerable: false, writable: true,
+ configurable: true });
}
return method.apply(this, Array.prototype.slice.call(arguments));
};
$dynamicBind.methods = methods;
Object.defineProperty(Object.prototype, name, { value: $dynamicBind,
- enumerable: false, configurable: true});
+ enumerable: false, writable: true, configurable: true});
return methods;
}
if (typeof $dynamicMetadata == 'undefined') $dynamicMetadata = [];
@@ -328,7 +327,7 @@
str = 'HTMLDocument';
}
return str;
-}, enumerable: false, configurable: true});""";
+}, enumerable: false, writable: true, configurable: true});""";
/** Snippet for `$inherits`. */
final String _INHERITS_FUNCTION = @"""
@@ -395,13 +394,13 @@
proto.$index = function(i) { return this[i]; }
}
return this[i];
-}, enumerable: false, configurable: true});
+}, enumerable: false, writable: true, configurable: true});
Object.defineProperty(Array.prototype, '$index', { value: function(i) {
return this[i];
-}, enumerable: false, configurable: true});
+}, enumerable: false, writable: true, configurable: true});
Object.defineProperty(String.prototype, '$index', { value: function(i) {
return this[i];
-}, enumerable: false, configurable: true});""";
+}, enumerable: false, writable: true, configurable: true});""";
/** Snippet for `$setindex` in Object, Array, and String. */
// TODO(jimhug): Add array bounds checking in checked mode
@@ -419,9 +418,10 @@
proto.$setindex = function(i, value) { return this[i] = value; }
}
return this[i] = value;
-}, enumerable: false, configurable: true});
+}, enumerable: false, writable: true, configurable: true});
Object.defineProperty(Array.prototype, '$setindex', { value: function(i, value) {
- return this[i] = value; }, enumerable: false, configurable: true});""";
+ return this[i] = value; }, enumerable: false, writable: true,
+ configurable: true});""";
/** Snippet for `$wrap_call$0`. */
final String _WRAP_CALL0_FUNCTION = @"""
« no previous file with comments | « client/tests/client/client.status ('k') | frog/gen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698