evaluation-order.js (578B)
1 // Copyright (C) 2014 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 12.2.8 5 description: Expressions should be evaluated in left-to-right order. 6 ---*/ 7 8 var tag = function(templateObject, a, b, c) { 9 callCount++; 10 assert.sameValue(a, 0); 11 assert.sameValue(b, 1); 12 assert.sameValue(c, 2); 13 }; 14 var i = 0; 15 var callCount; 16 17 assert.sameValue(`a${ i++ }b${ i++ }c${ i++ }d`, 'a0b1c2d'); 18 19 i = 0; 20 callCount = 0; 21 22 tag`a${ i++ }b${ i++ }c${ i++ }d`; 23 24 assert.sameValue(callCount, 1); 25 26 reportCompare(0, 0);