diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Map/prototype/set/replaces-a-value.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Map/prototype/set/replaces-a-value.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Map/prototype/set/replaces-a-value.js b/js/src/tests/test262/built-ins/Map/prototype/set/replaces-a-value.js new file mode 100644 index 0000000000..9fe4e95c3f --- /dev/null +++ b/js/src/tests/test262/built-ins/Map/prototype/set/replaces-a-value.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-map.prototype.set +description: > + Replaces a value in the map. +info: | + Map.prototype.set ( key , value ) + + ... + 5. Repeat for each Record {[[key]], [[value]]} p that is an element of + entries, + a. If p.[[key]] is not empty and SameValueZero(p.[[key]], key) is true, then + i. Set p.[[value]] to value. + ii. Return M. + ... +---*/ + +var m = new Map([['item', 1]]); + +m.set('item', 42); +assert.sameValue(m.get('item'), 42); +assert.sameValue(m.size, 1); + +reportCompare(0, 0); |