tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/assign/Target-Undefined.js
raw| 1 | // Copyright 2015 Microsoft Corporation. All rights reserved. |
| 2 | // This code is governed by the license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | description: > |
| 6 | Test the first argument(target) of Object.Assign(target,...sources), |
| 7 | if target is Undefined,Should Throw a TypeError exception. |
| 8 | es6id: 19.1.2.1.1 |
| 9 | ---*/ |
| 10 | |
| 11 | assert.throws(TypeError, function() { |
| 12 | Object.assign(undefined, { |
| 13 | a: 1 |
| 14 | }); |
| 15 | }); |