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

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

Issue 11348193: Object.observe: Tests for __define{G,S}etter__. (Closed) Base URL: https://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
« no previous file with comments | « no previous file | 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 fbf4bf49a1d362faa4658a7a4a9852c0994df784..474bfcd3bc49bb7aeb8f7a8d92e97f725161ca5d 100644
--- a/test/mjsunit/harmony/object-observe.js
+++ b/test/mjsunit/harmony/object-observe.js
@@ -405,7 +405,12 @@ function TestObserveConfigurable(obj, prop) {
Object.defineProperty(obj, prop, {get: frozenFunction, set: frozenFunction});
Object.defineProperty(obj, prop, {set: frozenFunction}); // ignored
Object.defineProperty(obj, prop, {get: undefined, set: frozenFunction});
+ obj.__defineSetter__(prop, frozenFunction); // ignored
+ obj.__defineSetter__(prop, function() {});
+ obj.__defineGetter__(prop, function() {});
delete obj[prop];
+ delete obj[prop]; // ignored
+ obj.__defineGetter__(prop, function() {});
delete obj[prop];
Object.defineProperty(obj, prop, {get: function() {}, configurable: true});
Object.defineProperty(obj, prop, {value: 9, writable: true});
@@ -427,6 +432,10 @@ function TestObserveConfigurable(obj, prop) {
{ object: obj, name: prop, type: "reconfigured" },
{ object: obj, name: prop, type: "reconfigured" },
{ object: obj, name: prop, type: "reconfigured" },
+ { object: obj, name: prop, type: "reconfigured" },
+ { object: obj, name: prop, type: "reconfigured" },
+ { object: obj, name: prop, type: "deleted" },
+ { object: obj, name: prop, type: "new" },
{ object: obj, name: prop, type: "deleted" },
{ object: obj, name: prop, type: "new" },
{ object: obj, name: prop, type: "reconfigured" },
@@ -466,7 +475,11 @@ function TestObserveNonConfigurable(obj, prop) {
function createProxy(create, x) {
var handler = {
getPropertyDescriptor: function(k) {
- return Object.getOwnPropertyDescriptor(this.target, k);
+ for (var o = this.target; o; o = Object.getPrototypeOf(o)) {
+ var desc = Object.getOwnPropertyDescriptor(o, k);
+ if (desc) return desc;
+ }
+ return undefined;
},
getOwnPropertyDescriptor: function(k) {
return Object.getOwnPropertyDescriptor(this.target, k);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698