summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-2-43.js
blob: 1ae725bc0f877c75f75fc475047554897a32d03b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.3-2-43
description: >
    Object.getOwnPropertyDescriptor - argument 'P' is an object which
    has an own valueOf method
---*/

var obj = {
  "[object Object]": 1,
  "abc": 2
};

var ownProp = {
  valueOf: function() {
    return "abc";
  }
};

var desc = Object.getOwnPropertyDescriptor(obj, ownProp);

assert.sameValue(desc.value, 1, 'desc.value');

reportCompare(0, 0);