OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
(...skipping 5332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5343 DCHECK(stat->is_target_for_anonymous()); | 5343 DCHECK(stat->is_target_for_anonymous()); |
5344 if (anonymous || ContainsLabel(stat->labels(), label)) { | 5344 if (anonymous || ContainsLabel(stat->labels(), label)) { |
5345 return stat; | 5345 return stat; |
5346 } | 5346 } |
5347 } | 5347 } |
5348 return NULL; | 5348 return NULL; |
5349 } | 5349 } |
5350 | 5350 |
5351 | 5351 |
5352 void Parser::HandleSourceURLComments(Isolate* isolate, Handle<Script> script) { | 5352 void Parser::HandleSourceURLComments(Isolate* isolate, Handle<Script> script) { |
5353 if (scanner_.source_url()->length() > 0) { | 5353 Handle<String> source_url = scanner_.SourceUrl(isolate); |
5354 Handle<String> source_url = scanner_.source_url()->Internalize(isolate); | 5354 if (!source_url.is_null()) { |
5355 script->set_source_url(*source_url); | 5355 script->set_source_url(*source_url); |
5356 } | 5356 } |
5357 if (scanner_.source_mapping_url()->length() > 0) { | 5357 Handle<String> source_mapping_url = scanner_.SourceMappingUrl(isolate); |
5358 Handle<String> source_mapping_url = | 5358 if (!source_mapping_url.is_null()) { |
5359 scanner_.source_mapping_url()->Internalize(isolate); | |
5360 script->set_source_mapping_url(*source_mapping_url); | 5359 script->set_source_mapping_url(*source_mapping_url); |
5361 } | 5360 } |
5362 } | 5361 } |
5363 | 5362 |
5364 | 5363 |
5365 void Parser::Internalize(Isolate* isolate, Handle<Script> script, bool error) { | 5364 void Parser::Internalize(Isolate* isolate, Handle<Script> script, bool error) { |
5366 // Internalize strings. | 5365 // Internalize strings. |
5367 ast_value_factory()->Internalize(isolate); | 5366 ast_value_factory()->Internalize(isolate); |
5368 | 5367 |
5369 // Error processing. | 5368 // Error processing. |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7075 node->Print(Isolate::Current()); | 7074 node->Print(Isolate::Current()); |
7076 } | 7075 } |
7077 #endif // DEBUG | 7076 #endif // DEBUG |
7078 | 7077 |
7079 #undef CHECK_OK | 7078 #undef CHECK_OK |
7080 #undef CHECK_OK_VOID | 7079 #undef CHECK_OK_VOID |
7081 #undef CHECK_FAILED | 7080 #undef CHECK_FAILED |
7082 | 7081 |
7083 } // namespace internal | 7082 } // namespace internal |
7084 } // namespace v8 | 7083 } // namespace v8 |
OLD | NEW |