OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 7529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7540 const Error& error = Error::Handle(isolate(), LanguageError::NewFormattedV( | 7540 const Error& error = Error::Handle(isolate(), LanguageError::NewFormattedV( |
7541 Error::Handle(isolate()), script_, token_pos, | 7541 Error::Handle(isolate()), script_, token_pos, |
7542 LanguageError::kWarning, Heap::kNew, | 7542 LanguageError::kWarning, Heap::kNew, |
7543 format, args)); | 7543 format, args)); |
7544 va_end(args); | 7544 va_end(args); |
7545 if (FLAG_warning_as_error) { | 7545 if (FLAG_warning_as_error) { |
7546 isolate()->long_jump_base()->Jump(1, error); | 7546 isolate()->long_jump_base()->Jump(1, error); |
7547 UNREACHABLE(); | 7547 UNREACHABLE(); |
7548 } else { | 7548 } else { |
7549 OS::Print("%s", error.ToErrorCString()); | 7549 OS::Print("%s", error.ToErrorCString()); |
| 7550 va_start(args, format); |
| 7551 Exceptions::TraceJSWarningV(script_, token_pos, format, args); |
| 7552 va_end(args); |
7550 } | 7553 } |
7551 } | 7554 } |
7552 | 7555 |
7553 | 7556 |
7554 void Parser::Warning(const char* format, ...) { | 7557 void Parser::Warning(const char* format, ...) { |
7555 if (FLAG_silent_warnings) return; | 7558 if (FLAG_silent_warnings) return; |
7556 va_list args; | 7559 va_list args; |
7557 va_start(args, format); | 7560 va_start(args, format); |
7558 const Error& error = Error::Handle(isolate(), LanguageError::NewFormattedV( | 7561 const Error& error = Error::Handle(isolate(), LanguageError::NewFormattedV( |
7559 Error::Handle(isolate()), script_, TokenPos(), | 7562 Error::Handle(isolate()), script_, TokenPos(), |
7560 LanguageError::kWarning, Heap::kNew, | 7563 LanguageError::kWarning, Heap::kNew, |
7561 format, args)); | 7564 format, args)); |
7562 va_end(args); | 7565 va_end(args); |
7563 if (FLAG_warning_as_error) { | 7566 if (FLAG_warning_as_error) { |
7564 isolate()->long_jump_base()->Jump(1, error); | 7567 isolate()->long_jump_base()->Jump(1, error); |
7565 UNREACHABLE(); | 7568 UNREACHABLE(); |
7566 } else { | 7569 } else { |
7567 OS::Print("%s", error.ToErrorCString()); | 7570 OS::Print("%s", error.ToErrorCString()); |
| 7571 va_start(args, format); |
| 7572 Exceptions::TraceJSWarningV(script_, TokenPos(), format, args); |
| 7573 va_end(args); |
7568 } | 7574 } |
7569 } | 7575 } |
7570 | 7576 |
7571 | 7577 |
7572 void Parser::Unimplemented(const char* msg) { | 7578 void Parser::Unimplemented(const char* msg) { |
7573 ErrorMsg(TokenPos(), "%s", msg); | 7579 ErrorMsg(TokenPos(), "%s", msg); |
7574 } | 7580 } |
7575 | 7581 |
7576 | 7582 |
7577 void Parser::CheckToken(Token::Kind token_expected, const char* msg) { | 7583 void Parser::CheckToken(Token::Kind token_expected, const char* msg) { |
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11066 void Parser::SkipQualIdent() { | 11072 void Parser::SkipQualIdent() { |
11067 ASSERT(IsIdentifier()); | 11073 ASSERT(IsIdentifier()); |
11068 ConsumeToken(); | 11074 ConsumeToken(); |
11069 if (CurrentToken() == Token::kPERIOD) { | 11075 if (CurrentToken() == Token::kPERIOD) { |
11070 ConsumeToken(); // Consume the kPERIOD token. | 11076 ConsumeToken(); // Consume the kPERIOD token. |
11071 ExpectIdentifier("identifier expected after '.'"); | 11077 ExpectIdentifier("identifier expected after '.'"); |
11072 } | 11078 } |
11073 } | 11079 } |
11074 | 11080 |
11075 } // namespace dart | 11081 } // namespace dart |
OLD | NEW |