Say I have an object which assigns properties based off the return value of a function:
var i = 0;
var f = function() { return ++i; }
var foo = {
Standard ECMA-262 (5.1) - Section 11.1.5 - Object Initialiser
The production PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment is evaluated as follows:
1. Let obj be the result of evaluating PropertyNameAndValueList. 2. Let propId be the result of evaluating PropertyAssignment. ... 5. Call the [[DefineOwnProperty]] internal method of obj with arguments propId.name, propId.descriptor, and false. 6. Return obj.
So yes, the order is enforced by the standard.