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 5178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5189 return !parser.failed(); | 5189 return !parser.failed(); |
5190 } | 5190 } |
5191 | 5191 |
5192 | 5192 |
5193 bool ParserApi::Parse(CompilationInfo* info) { | 5193 bool ParserApi::Parse(CompilationInfo* info) { |
5194 ASSERT(info->function() == NULL); | 5194 ASSERT(info->function() == NULL); |
5195 FunctionLiteral* result = NULL; | 5195 FunctionLiteral* result = NULL; |
5196 Handle<Script> script = info->script(); | 5196 Handle<Script> script = info->script(); |
5197 bool harmony_scoping = !info->is_native() && FLAG_harmony_scoping; | 5197 bool harmony_scoping = !info->is_native() && FLAG_harmony_scoping; |
5198 if (info->is_lazy()) { | 5198 if (info->is_lazy()) { |
5199 Parser parser(script, true, NULL, NULL); | 5199 Parser parser(script, info->isolate()->bootstrapper()->IsActive() || info->a
llows_natives_syntax(), NULL, NULL); |
5200 parser.SetHarmonyScoping(harmony_scoping); | 5200 parser.SetHarmonyScoping(harmony_scoping); |
5201 result = parser.ParseLazy(info); | 5201 result = parser.ParseLazy(info); |
5202 } else { | 5202 } else { |
5203 // Whether we allow %identifier(..) syntax. | 5203 // Whether we allow %identifier(..) syntax. |
5204 bool allow_natives_syntax = | 5204 bool allow_natives_syntax = |
5205 info->allows_natives_syntax() || FLAG_allow_natives_syntax; | 5205 info->allows_natives_syntax() || FLAG_allow_natives_syntax; |
5206 ScriptDataImpl* pre_data = info->pre_parse_data(); | 5206 ScriptDataImpl* pre_data = info->pre_parse_data(); |
5207 Parser parser(script, | 5207 Parser parser(script, |
5208 allow_natives_syntax, | 5208 allow_natives_syntax, |
5209 info->extension(), | 5209 info->extension(), |
(...skipping 15 matching lines...) Expand all Loading... |
5225 result = parser.ParseProgram(source, | 5225 result = parser.ParseProgram(source, |
5226 info->is_global(), | 5226 info->is_global(), |
5227 info->StrictMode()); | 5227 info->StrictMode()); |
5228 } | 5228 } |
5229 } | 5229 } |
5230 info->SetFunction(result); | 5230 info->SetFunction(result); |
5231 return (result != NULL); | 5231 return (result != NULL); |
5232 } | 5232 } |
5233 | 5233 |
5234 } } // namespace v8::internal | 5234 } } // namespace v8::internal |
OLD | NEW |