Debian Codegraph @

js/src/tests/test262/language/destructuring/binding/initialization-requires-object-coercible-null.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es6id: 13.3.3.5
6 description: >
7 Cannot convert null argument value to object
8 info: |
9 13.3.3.5 Runtime Semantics: BindingInitialization
10
11 BindingPattern : ObjectBindingPattern
12
13 1. Let valid be RequireObjectCoercible(value).
14 2. ReturnIfAbrupt(valid).
15 features: [destructuring-binding]
16 ---*/
17
18 function fn({}) {}
19
20 assert.throws(TypeError, function() {
21 fn(null);
22 });
23
24 reportCompare(0, 0);