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

Side by Side Diff: pkg/compiler/lib/src/js_backend/js_interop_analysis.dart

Issue 2110273003: Make is checks work on JavaScriptFunction objects. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Analysis to determine how to generate code for typed JavaScript interop. 5 /// Analysis to determine how to generate code for typed JavaScript interop.
6 library compiler.src.js_backend.js_interop_analysis; 6 library compiler.src.js_backend.js_interop_analysis;
7 7
8 import '../common.dart'; 8 import '../common.dart';
9 import '../constants/values.dart' 9 import '../constants/values.dart'
10 show ConstantValue, ConstructedConstantValue, StringConstantValue; 10 show ConstantValue, ConstructedConstantValue, StringConstantValue;
11 import '../dart_types.dart'
12 show
13 DartType,
14 DynamicType,
15 FunctionType;
11 import '../diagnostics/messages.dart' show MessageKind; 16 import '../diagnostics/messages.dart' show MessageKind;
12 import '../elements/elements.dart' 17 import '../elements/elements.dart'
13 show 18 show
14 ClassElement, 19 ClassElement,
15 Element, 20 Element,
16 FieldElement, 21 FieldElement,
17 FunctionElement, 22 FunctionElement,
18 LibraryElement, 23 LibraryElement,
19 ParameterElement, 24 ParameterElement,
20 MetadataAnnotation; 25 MetadataAnnotation;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 183
179 var name = backend.namer.invocationName(selector); 184 var name = backend.namer.invocationName(selector);
180 statements.add(js.statement( 185 statements.add(js.statement(
181 'Function.prototype.# = function(#) { return this(#) }', 186 'Function.prototype.# = function(#) { return this(#) }',
182 [name, parameters, parameters])); 187 [name, parameters, parameters]));
183 } 188 }
184 }); 189 });
185 }); 190 });
186 return new jsAst.Block(statements); 191 return new jsAst.Block(statements);
187 } 192 }
193
194 FunctionType buildJsFunctionType() {
195 // TODO(jacobr): consider using codegenWorld.isChecks to determine the
196 // range of positional arguments that need to be supported by JavaScript
197 // function types.
198 return new FunctionType.synthesized(
199 const DynamicType(),
200 [],
201 new List<DartType>.generate(16, (_) => const DynamicType()));
sra1 2016/06/30 17:57:13 This is ok since it is a one-of thing, but conside
Jacob 2016/07/01 18:27:50 filled is better. Forgot we had that constructor.
202 }
188 } 203 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698