Primitive this values of accessors should not be coerced in strict mode (#3854)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
@@ -32,3 +32,19 @@ Object.defineProperty(Box.prototype, 'data', {
|
||||
assert(box.data === '=');
|
||||
box.data = '+';
|
||||
assert(box.data === '+');
|
||||
|
||||
function test_access(value, proto) {
|
||||
"use strict"
|
||||
|
||||
Object.defineProperty(proto, 'test', {
|
||||
get: function () { assert (this === value) },
|
||||
set: function () { assert (this === value) }
|
||||
});
|
||||
|
||||
value.test;
|
||||
value.test = undefined;
|
||||
}
|
||||
|
||||
test_access ("str", String.prototype);
|
||||
test_access (1, Number.prototype);
|
||||
test_access (true, Boolean.prototype);
|
||||
|
||||
Reference in New Issue
Block a user