OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 PreParser::SourceElements PreParser::ParseSourceElements(int end_token, | 172 PreParser::SourceElements PreParser::ParseSourceElements(int end_token, |
173 bool* ok) { | 173 bool* ok) { |
174 // SourceElements :: | 174 // SourceElements :: |
175 // (Statement)* <end_token> | 175 // (Statement)* <end_token> |
176 | 176 |
177 bool allow_directive_prologue = true; | 177 bool allow_directive_prologue = true; |
178 while (peek() != end_token) { | 178 while (peek() != end_token) { |
179 Statement statement = ParseSourceElement(CHECK_OK); | 179 Statement statement = ParseSourceElement(CHECK_OK); |
180 if (allow_directive_prologue) { | 180 if (allow_directive_prologue) { |
181 if (statement.IsUseStrictLiteral()) { | 181 if (statement.IsUseStrictLiteral()) { |
182 set_language_mode(harmony_scoping_ ? | 182 set_language_mode(allow_harmony_scoping() ? |
183 i::EXTENDED_MODE : i::STRICT_MODE); | 183 i::EXTENDED_MODE : i::STRICT_MODE); |
184 } else if (!statement.IsStringLiteral()) { | 184 } else if (!statement.IsStringLiteral()) { |
185 allow_directive_prologue = false; | 185 allow_directive_prologue = false; |
186 } | 186 } |
187 } | 187 } |
188 } | 188 } |
189 return kUnknownSourceElements; | 189 return kUnknownSourceElements; |
190 } | 190 } |
191 | 191 |
192 | 192 |
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); | 1806 backing_store_.Add(static_cast<byte>((ascii_length >> 14) | 0x80u)); |
1807 } | 1807 } |
1808 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); | 1808 backing_store_.Add(static_cast<byte>((ascii_length >> 7) | 0x80u)); |
1809 } | 1809 } |
1810 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); | 1810 backing_store_.Add(static_cast<byte>(ascii_length & 0x7f)); |
1811 | 1811 |
1812 backing_store_.AddBlock(bytes); | 1812 backing_store_.AddBlock(bytes); |
1813 return backing_store_.EndSequence().start(); | 1813 return backing_store_.EndSequence().start(); |
1814 } | 1814 } |
1815 } } // v8::preparser | 1815 } } // v8::preparser |
OLD | NEW |