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

Unified Diff: runtime/lib/invocation_mirror_patch.dart

Issue 30533004: Report correct error message in case of super invocation (fix issue 8208). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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/lib/invocation_mirror.h ('k') | runtime/lib/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/invocation_mirror_patch.dart
===================================================================
--- runtime/lib/invocation_mirror_patch.dart (revision 29041)
+++ runtime/lib/invocation_mirror_patch.dart (working copy)
@@ -13,20 +13,22 @@
static const int _TYPE_BITS = 2;
static const int _TYPE_MASK = (1 << _TYPE_BITS) - 1;
- // These values, except _DYNAMIC, are only used when throwing
+ // These values, except _DYNAMIC and _SUPER, are only used when throwing
// NoSuchMethodError for compile-time resolution failures.
static const int _DYNAMIC = 0;
- static const int _STATIC = 1;
- static const int _CONSTRUCTOR = 2;
- static const int _TOP_LEVEL = 3;
+ static const int _SUPER = 1;
+ static const int _STATIC = 2;
+ static const int _CONSTRUCTOR = 3;
+ static const int _TOP_LEVEL = 4;
static const int _CALL_SHIFT = _TYPE_BITS;
- static const int _CALL_BITS = 2;
+ static const int _CALL_BITS = 3;
static const int _CALL_MASK = (1 << _CALL_BITS) - 1;
// Internal representation of the invocation mirror.
final String _functionName;
final List _argumentsDescriptor;
final List _arguments;
+ final bool _isSuperInvocation;
// External representation of the invocation mirror; populated on demand.
Symbol _memberName;
@@ -45,7 +47,7 @@
new _collection_dev.Symbol.unvalidated(
_functionName.substring(4) + "=");
} else {
- _type = _METHOD;
+ _type = _isSuperInvocation ? (_SUPER << _CALL_SHIFT) | _METHOD : _METHOD;
_memberName = new _collection_dev.Symbol.unvalidated(_functionName);
}
}
@@ -93,38 +95,43 @@
if (_type == null) {
_setMemberNameAndType();
}
- return _type == _METHOD;
+ return (_type & _TYPE_MASK) == _METHOD;
}
bool get isAccessor {
if (_type == null) {
_setMemberNameAndType();
}
- return _type != _METHOD;
+ return (_type & _TYPE_MASK) != _METHOD;
}
bool get isGetter {
if (_type == null) {
_setMemberNameAndType();
}
- return _type == _GETTER;
+ return (_type & _TYPE_MASK) == _GETTER;
}
bool get isSetter {
if (_type == null) {
_setMemberNameAndType();
}
- return _type == _SETTER;
+ return (_type & _TYPE_MASK) == _SETTER;
}
_InvocationMirror(this._functionName,
this._argumentsDescriptor,
- this._arguments);
+ this._arguments,
+ this._isSuperInvocation);
static _allocateInvocationMirror(String functionName,
List argumentsDescriptor,
- List arguments) {
- return new _InvocationMirror(functionName, argumentsDescriptor, arguments);
+ List arguments,
+ bool isSuperInvocation) {
+ return new _InvocationMirror(functionName,
+ argumentsDescriptor,
+ arguments,
+ isSuperInvocation);
}
static _invoke(Object receiver,
« no previous file with comments | « runtime/lib/invocation_mirror.h ('k') | runtime/lib/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698