summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/JSON/stringify/value-function.js
blob: e4b18d857f5ac8fe337df8ec51ad8b92777cde0a (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
// Copyright (C) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-serializejsonproperty
description: >
  Function values are ignored.
info: |
  JSON.stringify ( value [ , replacer [ , space ] ] )

  [...]
  12. Return ? SerializeJSONProperty(the empty String, wrapper).

  SerializeJSONProperty ( key, holder )

  [...]
  10. If Type(value) is Object and IsCallable(value) is false, then
    [...]
  11. Return undefined.
---*/

assert.sameValue(JSON.stringify(function() {}), undefined);
assert.sameValue(JSON.stringify([function() {}]), '[null]');
assert.sameValue(JSON.stringify({key: function() {}}), '{}');

reportCompare(0, 0);