OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var a = { |
| 6 "33": true, |
| 7 "-1": true |
| 8 }; |
| 9 |
| 10 var strkeys = Object.keys(a).map(function(k) { return "" + k }); |
| 11 var numkeys = Object.keys(a).map(function(k) { return +k }); |
| 12 var keys = strkeys.concat(numkeys); |
| 13 |
| 14 keys.forEach(function(k) { |
| 15 assertTrue(a.hasOwnProperty(k), |
| 16 "property not found: " + k + "(" + (typeof k) + ")"); |
| 17 }); |
| 18 |
| 19 var b = {}; |
| 20 b.__proto__ = a; |
| 21 keys.forEach(function(k) { |
| 22 assertTrue(k in b, "property not found: " + k + "(" + (typeof k) + ")"); |
| 23 }); |
OLD | NEW |