legacy-octal-integer.js (1402B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-literals-numeric-literals 5 description: Mathematical value for LegacyOctalIntegerLiteral 6 info: | 7 NumericLiteral :: 8 DecimalLiteral 9 BinaryIntegerLiteral 10 OctalIntegerLiteral 11 HexIntegerLiteral 12 LegacyOctalIntegerLiteral 13 14 LegacyOctalIntegerLiteral :: 15 0 OctalDigit 16 LegacyOctalIntegerLiteral OctalDigit 17 flags: [noStrict] 18 ---*/ 19 20 // LegacyOctalIntegerLiteral :: 21 // 0 OctalDigit 22 assert.sameValue(00, 0, '00'); 23 assert.sameValue(01, 1, '01'); 24 assert.sameValue(02, 2, '02'); 25 assert.sameValue(03, 3, '03'); 26 assert.sameValue(04, 4, '04'); 27 assert.sameValue(05, 5, '05'); 28 assert.sameValue(06, 6, '06'); 29 assert.sameValue(07, 7, '07'); 30 31 // LegacyOctalIntegerLiteral :: 32 // LegacyOctalIntegerLiteral OctalDigit 33 assert.sameValue(000, 0, '000'); 34 assert.sameValue(001, 1, '001'); 35 assert.sameValue(002, 2, '002'); 36 assert.sameValue(003, 3, '003'); 37 assert.sameValue(004, 4, '004'); 38 assert.sameValue(005, 5, '005'); 39 assert.sameValue(006, 6, '006'); 40 assert.sameValue(007, 7, '007'); 41 42 assert.sameValue(070, 56); 43 assert.sameValue(071, 57); 44 assert.sameValue(072, 58); 45 assert.sameValue(073, 59); 46 assert.sameValue(074, 60); 47 assert.sameValue(075, 61); 48 assert.sameValue(076, 62); 49 assert.sameValue(077, 63); 50 51 reportCompare(0, 0);