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

Side by Side Diff: frog/gen.dart

Issue 8469016: Adding in-browser correctness testing via selenium. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Top level generator object for writing code and keeping track of 6 * Top level generator object for writing code and keeping track of
7 * dependencies. 7 * dependencies.
8 * 8 *
9 * Should have two compilation models, but only one implemented so far. 9 * Should have two compilation models, but only one implemented so far.
10 * 10 *
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 _writeProperty(PropertyMember property) { 319 _writeProperty(PropertyMember property) {
320 if (property.getter != null) _writeMethod(property.getter); 320 if (property.getter != null) _writeMethod(property.getter);
321 if (property.setter != null) _writeMethod(property.setter); 321 if (property.setter != null) _writeMethod(property.setter);
322 322
323 if (property._provideFieldSyntax) { 323 if (property._provideFieldSyntax) {
324 writer.enterBlock('Object.defineProperty(' + 324 writer.enterBlock('Object.defineProperty(' +
325 '${property.declaringType.jsname}.prototype, "${property.jsname}", {'); 325 '${property.declaringType.jsname}.prototype, "${property.jsname}", {');
326 if (property.getter != null) { 326 if (property.getter != null) {
327 writer.writeln( 327 writer.write(
328 'get: ${property.declaringType.jsname}.prototype.${property.getter.jsn ame},'); 328 'get: ${property.declaringType.jsname}.prototype.${property.getter.jsn ame}');
329 String endOfLine = '';
330 // The shenanigan below is to make IE happy -- IE 9 doesn't like a
331 // trailing comma on the last element in a list.
332 if (property.setter != null) {
333 endOfLine = ',';
334 }
335 writer.writeln(endOfLine);
Siggi Cherem (dart-lang) 2011/11/10 23:04:37 (nit): for this short logic, I prefer doing this i
329 } 336 }
330 if (property.setter != null) { 337 if (property.setter != null) {
331 writer.writeln( 338 writer.writeln(
332 'set: ${property.declaringType.jsname}.prototype.${property.setter.jsn ame}'); 339 'set: ${property.declaringType.jsname}.prototype.${property.setter.jsn ame}');
333 } 340 }
334 writer.exitBlock('});'); 341 writer.exitBlock('});');
335 } 342 }
336 } 343 }
337 344
338 _writeMethod(Member method) { 345 _writeMethod(Member method) {
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 result.add(new Value(world.varType, '\$$i', false, /*needsTemp:*/false)); 2230 result.add(new Value(world.varType, '\$$i', false, /*needsTemp:*/false));
2224 } 2231 }
2225 for (int i = bareCount; i < length; i++) { 2232 for (int i = bareCount; i < length; i++) {
2226 var name = getName(i); 2233 var name = getName(i);
2227 if (name == null) name = '\$$i'; 2234 if (name == null) name = '\$$i';
2228 result.add(new Value(world.varType, name, false, /*needsTemp:*/false)); 2235 result.add(new Value(world.varType, name, false, /*needsTemp:*/false));
2229 } 2236 }
2230 return new Arguments(nodes, result); 2237 return new Arguments(nodes, result);
2231 } 2238 }
2232 } 2239 }
OLDNEW
« no previous file with comments | « frog/frogsh ('k') | tests/language/language.status » ('j') | tools/test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698