I think this part of ECMAScript Spec should explain the operation of the new operator. That'sIn your case, that's 5 in the first section, and 6 on the second section. Basically, JS will call the constructor like a function.
#The new Operator
The production
NewExpression : new NewExpressionis evaluated as follows:
- Let ref be the result of evaluating NewExpression.
- Let constructor be GetValue(ref).
- If Type(constructor) is not Object, throw a TypeError exception.
- If constructor does not implement the [[Construct]] internal method, throw a TypeError exception.
- Return the result of calling the [[Construct]] internal method on constructor, providing no arguments (that is, an empty list of arguments).
The production
MemberExpression : new MemberExpression Argumentsis evaluated as follows:
- Let ref be the result of evaluating MemberExpression.
- Let constructor be GetValue(ref).
- Let argList be the result of evaluating Arguments, producing an internal list of argument values (11.2.4).
- If Type(constructor) is not Object, throw a TypeError exception.
- If constructor does not implement the [[Construct]] internal method, throw a TypeError exception.
- Return the result of calling the [[Construct]] internal method on constructor, providing the list argList as the argument values.