Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: runtime/vm/class_finalizer.cc

Issue 68113028: Lazily format LanguageError messages (fix issue 15069). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 30304)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -4,12 +4,12 @@
#include "vm/class_finalizer.h"
+#include "vm/code_generator.h"
#include "vm/flags.h"
#include "vm/heap.h"
#include "vm/isolate.h"
#include "vm/longjump.h"
#include "vm/object_store.h"
-#include "vm/parser.h"
#include "vm/symbols.h"
namespace dart {
@@ -2614,14 +2614,11 @@
const Type& type,
const char* format,
va_list args) {
- LanguageError& error = LanguageError::Handle();
- if (prev_error.IsNull()) {
- error ^= Parser::FormatError(
- script, type.token_pos(), "Error", format, args);
- } else {
- error ^= Parser::FormatErrorWithAppend(
- prev_error, script, type.token_pos(), "Error", format, args);
- }
+ LanguageError& error = LanguageError::Handle(
+ LanguageError::NewFormattedV(
+ prev_error, script, type.token_pos(),
+ LanguageError::kMalformedType, Heap::kOld,
+ format, args));
if (FLAG_error_on_bad_type) {
ReportError(error);
}
@@ -2684,13 +2681,11 @@
const char* format, ...) {
va_list args;
va_start(args, format);
- Error& error = Error::Handle();
- if (prev_error.IsNull()) {
- error ^= Parser::FormatError(script, token_pos, "Error", format, args);
- } else {
- error ^= Parser::FormatErrorWithAppend(
- prev_error, script, token_pos, "Error", format, args);
- }
+ Error& error = Error::Handle(
+ LanguageError::NewFormattedV(
+ prev_error, script, token_pos,
+ LanguageError::kError, Heap::kNew,
+ format, args));
va_end(args);
ReportError(error);
}
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698