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

Unified Diff: runtime/vm/parser.cc

Issue 10882007: Re-enable checking of native resolvers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/class_finalizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 11205)
+++ runtime/vm/parser.cc (working copy)
@@ -2069,6 +2069,22 @@
Function::Handle(innermost_function().raw());
innermost_function_ = func.raw();
+ // Check to ensure we don't have classes with native fields in libraries
+ // which do not have a native resolver. This check is delayed until the class
+ // is actually used. Invocation of a function in the class is the first point
+ // of use. Access of const static fields in the class do not trigger an error.
+ if (current_class().num_native_fields() != 0) {
+ const Library& lib = Library::Handle(current_class().library());
+ if (lib.native_entry_resolver() == NULL) {
+ const String& cls_name = String::Handle(current_class().Name());
+ const String& lib_name = String::Handle(lib.url());
+ ErrorMsg(current_class().token_pos(),
+ "class '%s' is trying to extend a native fields class, "
+ "but library '%s' has no native resolvers",
+ cls_name.ToCString(), lib_name.ToCString());
+ }
+ }
+
if (func.IsConstructor()) {
SequenceNode* statements = ParseConstructor(func, default_parameter_values);
innermost_function_ = saved_innermost_function.raw();
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698