Fix: Proxy set, if trap is undefined (#2536)

This commit is contained in:
Rick Waldron 2020-03-23 18:46:33 -04:00 committed by GitHub
parent 79146e5cf4
commit 344612b592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -1,11 +1,12 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved. // Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es6id: 9.5.9 esid: sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
description: > description: >
[[Set]] ( P, V, Receiver) [[Set]] ( P, V, Receiver)
8. If trap is undefined, then return target.[[Set]](P, V, Receiver). 7. If trap is undefined, then
a. Return ? target.[[Set]](P, V, Receiver)
features: [Proxy] features: [Proxy]
---*/ ---*/
@ -14,9 +15,9 @@ var target = {
attr: 1 attr: 1
}; };
var p = new Proxy(target, { var p = new Proxy(target, {
get: undefined set: undefined
}); });
p.attr = 1; p.attr = 2;
assert.sameValue(target.attr, 1); assert.sameValue(target.attr, 2);