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

Unified Diff: frog/member.dart

Issue 9151015: addressing 3 previous review comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 11 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 | « 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 8f3ee1cc46a0f922f0116948804a4b712a365350..d2fa90adbed9e2cccd8823fd856fcf515dd747ad 100644
--- a/frog/member.dart
+++ b/frog/member.dart
@@ -427,15 +427,6 @@ class FieldMember extends Member {
'\$globals.${declaringType.jsname}_$jsname', node.span);
}
}
- /*else if (target.isConst && isFinal) {
- // take advantage of consts and retrieve the value directly if possible
- var constTarget = target is GlobalValue ? target.dynamic.exp : target;
- if (constTarget is ConstObjectValue) {
- return constTarget.fields[name];
- } else if (constTarget.type == world.stringType && name == 'length') {
- return new Value(type, '${constTarget.actualValue.length}', node.span);
- }
- }*/
return new Value(type, '${target.code}.$jsname', node.span);
}
@@ -1057,7 +1048,8 @@ class MethodMember extends Member {
// Start of abstract interpretation to replace const hacks goes here
// TODO(jmesserly): using the "node" here feels really hacky
if (isConst && node is NewExpression && node.dynamic.isConst) {
- // !!!!!! Egregious hack !!!!!!!
+ // TODO(jimhug): Embedding JSSyntaxRegExp works around an annoying
+ // issue with tracking native constructors for const objects.
if (isNative || declaringType.name == 'JSSyntaxRegExp') {
// check that all args are const?
var code = 'new ${declaringType.nativeName}${ctor}($argsString)';
@@ -1068,7 +1060,6 @@ class MethodMember extends Member {
var newObject = new ObjectValue(true, newType, span);
newObject.initFields();
_evalConstConstructor(newObject, args);
- // ??? Does args.values include named args???
return world.gen.globalForConst(newObject, [args.values]);
} else {
var code = 'new ${declaringType.nativeName}${ctor}($argsString)';
« 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