OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 CHECK_EQU(i + 1, stream.pos()); | 689 CHECK_EQU(i + 1, stream.pos()); |
690 } | 690 } |
691 for (int i = kMaxUC16Char; i >= 0; i--) { | 691 for (int i = kMaxUC16Char; i >= 0; i--) { |
692 CHECK_EQU(i + 1, stream.pos()); | 692 CHECK_EQU(i + 1, stream.pos()); |
693 stream.PushBack(i); | 693 stream.PushBack(i); |
694 CHECK_EQU(i, stream.pos()); | 694 CHECK_EQU(i, stream.pos()); |
695 } | 695 } |
696 int i = 0; | 696 int i = 0; |
697 while (stream.pos() < kMaxUC16CharU) { | 697 while (stream.pos() < kMaxUC16CharU) { |
698 CHECK_EQU(i, stream.pos()); | 698 CHECK_EQU(i, stream.pos()); |
699 unsigned progress = stream.SeekForward(12); | 699 int progress = static_cast<int>(stream.SeekForward(12)); |
700 i += progress; | 700 i += progress; |
701 int32_t c = stream.Advance(); | 701 int32_t c = stream.Advance(); |
702 if (i <= kMaxUC16Char) { | 702 if (i <= kMaxUC16Char) { |
703 CHECK_EQ(i, c); | 703 CHECK_EQ(i, c); |
704 } else { | 704 } else { |
705 CHECK_EQ(-1, c); | 705 CHECK_EQ(-1, c); |
706 } | 706 } |
707 i += 1; | 707 i += 1; |
708 CHECK_EQU(i, stream.pos()); | 708 CHECK_EQU(i, stream.pos()); |
709 } | 709 } |
(...skipping 4267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4977 "const x = 1;", | 4977 "const x = 1;", |
4978 "class C {}", | 4978 "class C {}", |
4979 NULL}; | 4979 NULL}; |
4980 | 4980 |
4981 static const ParserFlag always_flags[] = { | 4981 static const ParserFlag always_flags[] = { |
4982 kAllowHarmonyClasses, kAllowHarmonyScoping | 4982 kAllowHarmonyClasses, kAllowHarmonyScoping |
4983 }; | 4983 }; |
4984 RunParserSyncTest(context_data, statement_data, kError, NULL, 0, | 4984 RunParserSyncTest(context_data, statement_data, kError, NULL, 0, |
4985 always_flags, arraysize(always_flags)); | 4985 always_flags, arraysize(always_flags)); |
4986 } | 4986 } |
OLD | NEW |