Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/native_handler.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/native_handler.dart (revision 17700) |
| +++ sdk/lib/_internal/compiler/implementation/native_handler.dart (working copy) |
| @@ -539,13 +539,22 @@ |
| return behavior; |
| } |
| var behavior = new NativeBehavior(); |
| + LinkBuilder<Element> types = new LinkBuilder<Element>(); |
|
ahe
2013/01/28 15:14:31
This looks like a list of "elements", not "types".
|
| for (final typeString in specString.split('|')) { |
| var type = _parseType(typeString, compiler, |
| (name) => resolver.resolveTypeFromString(name), |
| jsCall); |
| behavior.typesInstantiated.add(type); |
| behavior.typesReturned.add(type); |
| + if (type == SpecialType.JsObject) { |
| + types.addLast(compiler.objectClass); |
| + } else if (type == SpecialType.JsArray) { |
| + types.addLast(compiler.backend.listImplementation); |
| + } else { |
| + types.addLast(type.element); |
| + } |
| } |
| + compiler.typesTask.typedNodes[jsCall] = types.toLink(); |
|
ahe
2013/01/28 15:14:31
Please abstract this operation.
sra1
2013/01/28 20:12:20
Move the assignment out to the call site of ofJsCa
|
| return behavior; |
| } |
| @@ -880,8 +889,7 @@ |
| } |
| DartString jsCode = new DartString.literal(nativeMethodCall); |
| - builder.push( |
| - new HForeign(jsCode, const LiteralDartString('Object'), inputs)); |
| + builder.push(new HForeign(jsCode, HType.UNKNOWN, inputs)); |
| builder.close(new HReturn(builder.pop())).addSuccessor(builder.graph.exit); |
| } else { |
| if (parameters.parameterCount != 0) { |