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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart

Issue 2699073003: Support `void` as generic argument.
Patch Set: Add specialized messages for `void` for-ins. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.js_emitter.full_emitter; 5 library dart2js.js_emitter.full_emitter;
6 6
7 import 'dart:collection' show HashMap; 7 import 'dart:collection' show HashMap;
8 import 'dart:convert'; 8 import 'dart:convert';
9 9
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 case JsBuiltin.rawRtiToJsConstructorName: 360 case JsBuiltin.rawRtiToJsConstructorName:
361 return jsAst.js.expressionTemplateFor("#.$typeNameProperty"); 361 return jsAst.js.expressionTemplateFor("#.$typeNameProperty");
362 362
363 case JsBuiltin.rawRuntimeType: 363 case JsBuiltin.rawRuntimeType:
364 return jsAst.js.expressionTemplateFor("#.constructor"); 364 return jsAst.js.expressionTemplateFor("#.constructor");
365 365
366 case JsBuiltin.createFunctionTypeRti: 366 case JsBuiltin.createFunctionTypeRti:
367 return backend.rtiEncoder.templateForCreateFunctionType; 367 return backend.rtiEncoder.templateForCreateFunctionType;
368 368
369 case JsBuiltin.isVoidRti:
370 return backend.rtiEncoder.templateForIsVoidRti;
371
369 case JsBuiltin.isSubtype: 372 case JsBuiltin.isSubtype:
370 // TODO(floitsch): move this closer to where is-check properties are 373 // TODO(floitsch): move this closer to where is-check properties are
371 // built. 374 // built.
372 String isPrefix = namer.operatorIsPrefix; 375 String isPrefix = namer.operatorIsPrefix;
373 return jsAst.js 376 return jsAst.js
374 .expressionTemplateFor("('$isPrefix' + #) in #.prototype"); 377 .expressionTemplateFor("('$isPrefix' + #) in #.prototype");
375 378
376 case JsBuiltin.isGivenTypeRti: 379 case JsBuiltin.isGivenTypeRti:
377 return jsAst.js.expressionTemplateFor('#.$typeNameProperty === #'); 380 return jsAst.js.expressionTemplateFor('#.$typeNameProperty === #');
378 381
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 // data. 1923 // data.
1921 mapping["_comment"] = "This mapping shows which compiled `.js` files are " 1924 mapping["_comment"] = "This mapping shows which compiled `.js` files are "
1922 "needed for a given deferred library import."; 1925 "needed for a given deferred library import.";
1923 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); 1926 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap());
1924 compiler.outputProvider( 1927 compiler.outputProvider(
1925 compiler.options.deferredMapUri.path, '', OutputType.info) 1928 compiler.options.deferredMapUri.path, '', OutputType.info)
1926 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) 1929 ..add(const JsonEncoder.withIndent(" ").convert(mapping))
1927 ..close(); 1930 ..close();
1928 } 1931 }
1929 } 1932 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698