diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/symbol_property_valueOf.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/symbol_property_valueOf.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/symbol_property_valueOf.js b/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/symbol_property_valueOf.js new file mode 100644 index 0000000000..b844b6219f --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/symbol_property_valueOf.js @@ -0,0 +1,38 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Object.prototype.propertyIsEnumerable with symbol and valueOf conversion +info: | + 19.1.3.4 Object.prototype.propertyIsEnumerable ( V ) + + 1. Let P be ToPropertyKey(V). + 2. ReturnIfAbrupt(P). + ... +es6id: 19.1.3.4 +features: [Symbol] +---*/ + +var obj = {}; +var sym = Symbol(); + +var callCount = 0; +var wrapper = { + valueOf: function() { + callCount += 1; + return sym; + }, + toString: null +}; + +obj[sym] = 0; + +assert.sameValue( + obj.propertyIsEnumerable(wrapper), + true, + "Returns true if symbol own enumerable property found" +); + +assert.sameValue(callCount, 1, "valueOf method called exactly once"); + +reportCompare(0, 0); |