It is not possible.
The object is not bound in any scope visible to EcmaScript expressions when the property values are evaluated.
Section 11.1.5 of the EcmaScript language spec explains how the object constructor syntax works.
The following describes how the object is created as a side-effect of evaluating the first property key value pair
The production PropertyNameAndValueList : PropertyAssignment
is evaluated as follows:
- Let obj be the result of creating a new object as if by the expression
new Object()
where Object
is the standard built-in constructor with that name.
- Let propId be the result of evaluating PropertyAssignment.
- Call the [[DefineOwnProperty]] internal method of obj with arguments
propId.name
, propId.descriptor
, and false
.
- Return obj.
Note that PropertyAssignment is evaluated after obj is created, but obj is never bound to any name accessible to an EcmaScript expression.
Only after all the property values are evaluated is anything assigned to o
or any other symbol in your program.