Index: test/mjsunit/get-own-property-descriptor.js |
diff --git a/test/mjsunit/get-own-property-descriptor.js b/test/mjsunit/get-own-property-descriptor.js |
index ceb771538421d4f2be3b2601478e8af0502233d4..79c1fac6ae84f1f69146a88a6a1179f82bdd3b97 100644 |
--- a/test/mjsunit/get-own-property-descriptor.js |
+++ b/test/mjsunit/get-own-property-descriptor.js |
@@ -103,3 +103,19 @@ objWithProto.prototype = proto; |
objWithProto[0] = 'bar'; |
var descWithProto = Object.getOwnPropertyDescriptor(objWithProto, '10'); |
assertEquals(undefined, descWithProto); |
+ |
+// Test elements on global proxy object. |
+var global = (function() { return this; })(); |
+ |
+global[42] = 42; |
+ |
+function el_getter() { return 239; }; |
+function el_setter() {}; |
+Object.defineProperty(global, '239', {get: el_getter, set: el_setter}); |
+ |
+var descRegularElement = Object.getOwnPropertyDescriptor(global, '42'); |
+assertEquals(42, descRegularElement.value); |
+ |
+var descAccessorElement = Object.getOwnPropertyDescriptor(global, '239'); |
+assertEquals(el_getter, descAccessorElement.get); |
+assertEquals(el_setter, descAccessorElement.set); |