Bug 1008441 - Make Object.defineProperty(proxy, desc) only parse desc once. r=efaust.

This commit is contained in:
Jason Orendorff
2014-06-06 11:15:21 -04:00
parent 8c8d7d3e8e
commit 8836365bf4
6 changed files with 61 additions and 14 deletions

View File

@@ -2383,15 +2383,6 @@ Proxy::defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
return proxy->as<ProxyObject>().handler()->defineProperty(cx, proxy, id, desc);
}
bool
Proxy::defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v)
{
JS_CHECK_RECURSION(cx, return false);
Rooted<PropertyDescriptor> desc(cx);
return ParsePropertyDescriptorObject(cx, proxy, v, &desc) &&
Proxy::defineProperty(cx, proxy, id, &desc);
}
bool
Proxy::getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props)
{