invoked-with-new.js (482B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-symbol-constructor 5 description: The Symbol constructor may not be invoked with `new` 6 info: | 7 1. If NewTarget is not undefined, throw a TypeError exception. 8 features: [Symbol] 9 ---*/ 10 11 assert.throws(TypeError, function() { 12 new Symbol(); 13 }); 14 15 assert.throws(TypeError, function() { 16 new Symbol('1'); 17 }); 18 19 reportCompare(0, 0);