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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 895083002: Support tearoffs in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments Created 5 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 | « pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_helper.dart b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
index dd7f4dc27e6cc0e9857ca4a82f522cec1e7c75ab..7a75198df3ccaab7fb7ed24c9c56433c0fcc11ed 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_helper.dart
@@ -1956,14 +1956,15 @@ abstract class Closure implements Function {
*
* Further assumes that [reflectionInfo] is the end of the array created by
* [dart2js.js_emitter.ContainerBuilder.addMemberMethod] starting with
- * required parameter count.
+ * required parameter count or, in case of the new emitter, the runtime
+ * representation of the function's type.
*
* Caution: this function may be called when building constants.
* TODO(ahe): Don't call this function when building constants.
*/
static fromTearOff(receiver,
List functions,
- List reflectionInfo,
+ var reflectionInfo,
bool isStatic,
jsArguments,
String propertyName) {
@@ -1977,10 +1978,15 @@ abstract class Closure implements Function {
String name = JS('String|Null', '#.\$stubName', function);
String callName = JS('String|Null', '#.\$callName', function);
- JS('', '#.\$reflectionInfo = #', function, reflectionInfo);
- ReflectionInfo info = new ReflectionInfo(function);
+ var functionType;
+ if (reflectionInfo is List) {
+ JS('', '#.\$reflectionInfo = #', function, reflectionInfo);
+ ReflectionInfo info = new ReflectionInfo(function);
+ functionType = info.functionType;
+ } else {
+ functionType = reflectionInfo;
+ }
- var functionType = info.functionType;
// function tmp() {};
// tmp.prototype = BC.prototype;
@@ -2322,7 +2328,8 @@ closureFromTearOff(receiver,
return Closure.fromTearOff(
receiver,
JSArray.markFixedList(functions),
- JSArray.markFixedList(reflectionInfo),
+ reflectionInfo is List ? JSArray.markFixedList(reflectionInfo)
+ : reflectionInfo,
JS('bool', '!!#', isStatic),
jsArguments,
JS('String', '#', name));
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698