Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/values/tamper-with-object-keys.js

raw
1 // Copyright (C) 2015 Jordan Harband. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-object.values
6 description: >
7 Object.values should not have its behavior impacted by modifications to Object.keys
8 author: Jordan Harband
9 ---*/
10
11 function fakeObjectKeys() {
12 $ERROR('The overriden version of Object.keys was called!');
13 }
14
15 Object.keys = fakeObjectKeys;
16
17 assert.sameValue(Object.keys, fakeObjectKeys, 'Sanity check failed: could not modify the global Object.keys');
18 assert.sameValue(Object.values({
19 a: 1
20 }).length, 1, 'Expected object with 1 key to have 1 value');