See pp 114-5 of the JavaScript book