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

Guard against _nilGetSetObject sneaking in

This commit is contained in:
Robert Krimen
2014-02-14 23:22:47 -08:00
parent 99263cd960
commit 333bb23c07
2 changed files with 36 additions and 11 deletions

View File

@@ -568,6 +568,25 @@ func TestObjectGetterSetter(t *testing.T) {
var ghi = Object.getOwnPropertyDescriptor(abc, "def");
[ jkl instanceof TypeError, ghi.get === getter, ghi.set, ghi.configurable, ghi.enumerable ];
`, "true,true,,false,false")
test(`
var abc = {};
var def = "xyzzy";
Object.defineProperty(abc, "ghi", {
get: undefined,
set: function(value) {
def = value;
},
enumerable: true,
configurable: true
});
var hasOwn = abc.hasOwnProperty("ghi");
var descriptor = Object.getOwnPropertyDescriptor(abc, "ghi");
[ hasOwn, typeof descriptor.get ];
`, "true,undefined")
}
func TestProperty(t *testing.T) {