1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Fix Put to see set/get properties

This commit is contained in:
Robert Krimen
2014-02-15 10:20:33 -08:00
parent 333bb23c07
commit 5aa653244a
2 changed files with 72 additions and 12 deletions

View File

@@ -587,6 +587,24 @@ func TestObjectGetterSetter(t *testing.T) {
[ hasOwn, typeof descriptor.get ];
`, "true,undefined")
test(`
var abc = "xyzzy";
Object.defineProperty(Array.prototype, "abc", {
get: function () {
return abc;
},
set: function (value) {
abc = value;
},
enumerable: true,
configurable: true
});
var def = [];
def.abc = 3.14159;
[ def.hasOwnProperty("abc"), def.abc, abc ];
`, "false,3.14159,3.14159")
}
func TestProperty(t *testing.T) {