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

Unified Diff: test/mjsunit/harmony/object-observe.js

Issue 11414094: Make Object.observe on the global object functional (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/object-observe.js
diff --git a/test/mjsunit/harmony/object-observe.js b/test/mjsunit/harmony/object-observe.js
index 26d097ecee7f50106cd64f2e8ebe4aa8f73a7b4c..b9f4b43cf0d7f19b20caffea620765552f080d5f 100644
--- a/test/mjsunit/harmony/object-observe.js
+++ b/test/mjsunit/harmony/object-observe.js
@@ -56,7 +56,9 @@ function createObserver() {
assertCallbackRecords: function(recs) {
this.assertRecordCount(recs.length);
for (var i = 0; i < recs.length; i++) {
- print(i, JSON.stringify(this.records[i]), JSON.stringify(recs[i]));
+ try {
+ print(i, JSON.stringify(this.records[i]), JSON.stringify(recs[i]));
+ } catch (e) { }
rossberg 2012/11/21 12:43:17 Can you factor this out into a helper function tha
adamk 2012/11/21 17:02:57 Done.
assertSame(this.records[i].object, recs[i].object);
assertEquals('string', typeof recs[i].type);
assertPropertiesEqual(this.records[i], recs[i]);
@@ -462,7 +464,9 @@ function createProxy(create, x) {
},
target: {isProxy: true},
callback: function(changeRecords) {
- print("callback", JSON.stringify(handler.proxy), JSON.stringify(got));
+ try {
+ print("callback", JSON.stringify(handler.proxy), JSON.stringify(got));
+ } catch (e) { }
for (var i in changeRecords) {
var got = changeRecords[i];
var change = {object: handler.proxy, name: got.name, type: got.type};
@@ -503,9 +507,7 @@ function blacklisted(obj, prop) {
// TODO(observe): oldValue when reconfiguring array length
(obj instanceof Array && prop === "length") ||
// TODO(observe): prototype property on functions
- (obj instanceof Function && prop === "prototype") ||
- // TODO(observe): global object
- obj === this;
+ (obj instanceof Function && prop === "prototype")
}
for (var i in objects) for (var j in properties) {
@@ -513,7 +515,7 @@ for (var i in objects) for (var j in properties) {
var prop = properties[j];
if (blacklisted(obj, prop)) continue;
var desc = Object.getOwnPropertyDescriptor(obj, prop);
- print("***", typeof obj, JSON.stringify(obj), prop);
+ try { print("***", typeof obj, JSON.stringify(obj), prop) } catch (e) { };
if (!desc || desc.configurable)
TestObserveConfigurable(obj, prop);
else if (desc.writable)
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698