Correctly set the define property flags during [[Set] in case of Proxy (#4178)

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
Péter Gál
2020-09-02 17:34:15 +02:00
committed by GitHub
parent 074945dafa
commit f03bf9074f
3 changed files with 21 additions and 4 deletions
+13
View File
@@ -138,3 +138,16 @@ try {
} catch (e) {
assert(e instanceof TypeError);
}
/* Setting a new property should be configurable, enumerable, and writable by default
* over a proxy.
*/
var setPropProxy = new Proxy({}, {});
setPropProxy["alma"] = 3;
var desc = Object.getOwnPropertyDescriptor(setPropProxy, "alma");
assert(desc.writable === true);
assert(desc.enumerable === true);
assert(desc.configurable === true);
assert(desc.value === 3);