Chromium Code Reviews| 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) |