Describe the bug
Calling new on a primitive value (or, in other words, calling a primitive value as a constructor) does not error.
To Reproduce
const a = "";
new a();
Expected behavior
A TypeError is supposed to be raised. The spec can be found here (step 7). Chrome implements this properly:

Build environment (please complete the following information):
Windows 10Version 1909 (OS Build 18363.1082)x86_64-pc-windows-msvcrustc 1.46.0 (04488afe3 2020-08-24)Additional context
MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new
Spec: https://tc39.es/ecma262/#sec-evaluatenew
The problem is here boa/src/syntax/ast/node/new/mod.rs:58 we should throw a TypeError (with .throw_type_error()), but instead we are returning undefined
Hey @HalidOdat , I want to do this.
Thanks.
Most helpful comment
Hey @HalidOdat , I want to do this.
Thanks.