Commit 085bf78c authored by rossberg@chromium.org's avatar rossberg@chromium.org

Object.observe: Tests for __define{G,S}etter__.

R=adamk@chromium.org,rafaelw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/11348193

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13047 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1090d8e0
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment