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

Unified Diff: runtime/lib/error.cc

Issue 11712002: Remove NoSuchMethodErrorImplementation class and use NoSuchMethodError from core (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 months 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 | « no previous file | runtime/lib/error.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/error.cc
===================================================================
--- runtime/lib/error.cc (revision 16582)
+++ runtime/lib/error.cc (working copy)
@@ -140,42 +140,4 @@
return Object::null();
}
-
-// TODO(regis): This helper is used to compile a throw when a call cannot be
-// resolved at compile time. The thrown instance of NoSuchMethodError is of a
-// different type than a NoSuchMethodError thrown at runtime. This should be
-// merged.
-//
-// Allocate and throw NoSuchMethodError.
-// Arg0: index of the call that was not resolved at compile time.
-// Arg1: name of the method that was not resolved at compile time.
-// Return value: none, throws an exception.
-DEFINE_NATIVE_ENTRY(NoSuchMethodError_throwNew, 2) {
- GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_pos, arguments->NativeArgAt(0));
- GET_NON_NULL_NATIVE_ARGUMENT(
- String, function_name, arguments->NativeArgAt(1));
- intptr_t call_pos = smi_pos.Value();
- // Allocate a new instance of type NoSuchMethodError.
- const Instance& error = Instance::Handle(
- Exceptions::NewInstance("NoSuchMethodErrorImplementation"));
- ASSERT(!error.IsNull());
-
- // Initialize 'url', 'line', and 'column' fields.
- DartFrameIterator iterator;
- iterator.NextFrame(); // Skip native call.
- const Script& script = Script::Handle(Exceptions::GetCallerScript(&iterator));
- const Class& cls = Class::Handle(error.clazz());
- Exceptions::SetLocationFields(error, cls, script, call_pos);
- Exceptions::SetField(error, cls, "functionName", function_name);
-
- intptr_t line, column;
- script.GetTokenLocation(call_pos, &line, &column);
- Exceptions::SetField(error, cls, "failedResolutionLine",
- String::Handle(script.GetLine(line)));
-
- Exceptions::Throw(error);
- UNREACHABLE();
- return Object::null();
-}
-
} // namespace dart
« no previous file with comments | « no previous file | runtime/lib/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698