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

Unified Diff: frog/member.dart

Issue 8985010: Move tests using frog 'native' extension from tests/language to frog/tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « frog/gen.dart ('k') | frog/minfrog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/member.dart
diff --git a/frog/member.dart b/frog/member.dart
index a4ea30e4a96fa5d977575e1d055203a3ccaf43cb..b16370a2de6623e54b96c2fcf2e721118150ecfa 100644
--- a/frog/member.dart
+++ b/frog/member.dart
@@ -1061,9 +1061,17 @@ class MethodMember extends Member {
: '${declaringType.jsname}.call($argsString)';
return new Value(target.type, code, node.span);
} else {
+ // If a hidden native class has a direct (non-factory) constructor, use
+ // the native name. This will work if the name is available in the
+ // execution environment, and will fail at run-time if the name is really
+ // hidden. This lets the generated code run on some browsers before the
+ // browser compat issue is finalized.
+ var typeName = declaringType.isNative
+ ? declaringType.nativeType.name
+ : declaringType.jsname;
var code = (constructorName != '')
- ? 'new ${declaringType.jsname}.${constructorName}\$ctor($argsString)'
- : 'new ${declaringType.jsname}($argsString)';
+ ? 'new ${typeName}.${constructorName}\$ctor($argsString)'
+ : 'new ${typeName}($argsString)';
// TODO(jmesserly): using the "node" here feels really hacky
if (isConst && node is NewExpression && node.dynamic.isConst) {
return _invokeConstConstructor(node, code, target, args);
« no previous file with comments | « frog/gen.dart ('k') | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698