OLD | NEW |
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 case JsBuiltin.rawRtiToJsConstructorName: | 359 case JsBuiltin.rawRtiToJsConstructorName: |
360 return jsAst.js.expressionTemplateFor("#.$typeNameProperty"); | 360 return jsAst.js.expressionTemplateFor("#.$typeNameProperty"); |
361 | 361 |
362 case JsBuiltin.rawRuntimeType: | 362 case JsBuiltin.rawRuntimeType: |
363 return jsAst.js.expressionTemplateFor("#.constructor"); | 363 return jsAst.js.expressionTemplateFor("#.constructor"); |
364 | 364 |
365 case JsBuiltin.createFunctionTypeRti: | 365 case JsBuiltin.createFunctionTypeRti: |
366 return backend.rtiEncoder.templateForCreateFunctionType; | 366 return backend.rtiEncoder.templateForCreateFunctionType; |
367 | 367 |
| 368 case JsBuiltin.isVoidRti: |
| 369 return backend.rtiEncoder.templateForIsVoidRti; |
| 370 |
368 case JsBuiltin.isSubtype: | 371 case JsBuiltin.isSubtype: |
369 // TODO(floitsch): move this closer to where is-check properties are | 372 // TODO(floitsch): move this closer to where is-check properties are |
370 // built. | 373 // built. |
371 String isPrefix = namer.operatorIsPrefix; | 374 String isPrefix = namer.operatorIsPrefix; |
372 return jsAst.js | 375 return jsAst.js |
373 .expressionTemplateFor("('$isPrefix' + #) in #.prototype"); | 376 .expressionTemplateFor("('$isPrefix' + #) in #.prototype"); |
374 | 377 |
375 case JsBuiltin.isGivenTypeRti: | 378 case JsBuiltin.isGivenTypeRti: |
376 return jsAst.js.expressionTemplateFor('#.$typeNameProperty === #'); | 379 return jsAst.js.expressionTemplateFor('#.$typeNameProperty === #'); |
377 | 380 |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 // data. | 1933 // data. |
1931 mapping["_comment"] = "This mapping shows which compiled `.js` files are " | 1934 mapping["_comment"] = "This mapping shows which compiled `.js` files are " |
1932 "needed for a given deferred library import."; | 1935 "needed for a given deferred library import."; |
1933 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); | 1936 mapping.addAll(compiler.deferredLoadTask.computeDeferredMap()); |
1934 compiler.outputProvider( | 1937 compiler.outputProvider( |
1935 compiler.options.deferredMapUri.path, '', OutputType.info) | 1938 compiler.options.deferredMapUri.path, '', OutputType.info) |
1936 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) | 1939 ..add(const JsonEncoder.withIndent(" ").convert(mapping)) |
1937 ..close(); | 1940 ..close(); |
1938 } | 1941 } |
1939 } | 1942 } |
OLD | NEW |