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

Unified Diff: frog/frogsh

Issue 8540023: Only set initializer fields as fields, not properties. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Looks like I fixed a test! Created 9 years, 1 month 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 | frog/gen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/frogsh
diff --git a/frog/frogsh b/frog/frogsh
index dc6d0e4a7adbdc1f26dc52b592c8095f8e13733a..b1811c4e3aab38e9bc3198b9206b56d6e0e0b047 100755
--- a/frog/frogsh
+++ b/frog/frogsh
@@ -6960,7 +6960,6 @@ function Keyword(syntax, isPseudo) {
this.isPseudo = isPseudo;
// Initializers done
}
-Keyword.prototype.is$Keyword = function(){return this;};
Keyword.prototype.is$SourceString = function(){return this;};
Keyword.get$keywords = function() {
if ($notnull_bool(Keyword._keywords == null)) {
@@ -7067,8 +7066,7 @@ ArrayKeywordState.prototype.toString = function() {
}
// ********** Code for LeafKeywordState **************
function LeafKeywordState(syntax) {
- var $0;
- this.keyword = (($0 = Keyword.get$keywords().$index(syntax)) && $0.is$Keyword());
+ this.keyword = Keyword.get$keywords().$index(syntax);
// Initializers done
}
$inherits(LeafKeywordState, KeywordState);
@@ -11113,7 +11111,6 @@ MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
}
}
MethodGenerator.prototype.writeBody = function() {
- var $0;
var initializers = null;
var initializedFields = null;
if ($notnull_bool(this.method.get$isConstructor())) {
@@ -11179,9 +11176,17 @@ MethodGenerator.prototype.writeBody = function() {
world.error('invalid left side of initializer', left.get$span());
continue;
}
- initializedFields.add(left.get$name().get$name());
- var assign = this._makeThisValue(null).set_(this, $assert_String(left.get$name().get$name()), (($0 = left.get$name()) && $0.is$lang_Node()), (($0 = this.visitValue(init.y)) && $0.is$Value()), false);
- this.writer.writeln(('' + assign.code + ';'));
+ var f = this.method.declaringType.getMember(left.get$name().get$name());
+ if ($notnull_bool(f == null)) {
+ world.error('bad initializer - no matching field', left.get$span());
+ continue;
+ }
+ else if ($notnull_bool(!$notnull_bool(f.get$isField()))) {
+ world.error(('"' + left.get$name().get$name() + '" does not refer to a field'), left.get$span());
+ continue;
+ }
+ initializedFields.add(f.get$name());
+ this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValue(init.y).code + ';'));
}
else {
world.error('invalid initializer', init.get$span());
@@ -12190,7 +12195,7 @@ MethodGenerator.prototype.visitNullExpression = function(node) {
MethodGenerator.prototype.visitLiteralExpression = function(node) {
var $0;
var type = node.type.type;
- $assert($ne(type, null), "type != null", "gen.dart", 2073, 12);
+ $assert($ne(type, null), "type != null", "gen.dart", 2081, 12);
if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) {
var items = [];
var $list = node.value;
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698