Chromium Code Reviews| Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
| index 3ae2c1bd8b306e4d385366a8cd3a4fd3465aa8bd..8876a7e0cf274ef1fd45a6bc9267c20968f84e65 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
| @@ -796,7 +796,10 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive> |
| /// Creates a primitive for the default value of [parameter]. |
| ir.Primitive translateDefaultValue(ParameterElement parameter) { |
| - if (parameter.initializer == null) { |
| + if (parameter.initializer == null || |
| + // TODO(sigmund): revisit whether js-interop should omit default values |
| + // on purpose (Issue #25759). |
|
Jacob
2016/02/11 17:54:33
Change comment to
JS interop does not allow defau
Siggi Cherem (dart-lang)
2016/02/11 21:16:53
Done.
|
| + backend.isJsInterop(parameter.functionDeclaration)) { |
| return irBuilder.buildNullConstant(); |
| } else { |
| return inlineConstant(parameter.executableContext, parameter.initializer); |
| @@ -3921,4 +3924,22 @@ class GlobalProgramInformation { |
| void addNativeMethod(FunctionElement function) { |
| _backend.emitter.nativeEmitter.nativeMethods.add(function); |
| } |
| + |
| + bool get trustJSInteropTypeAnnotations => |
| + _compiler.trustJSInteropTypeAnnotations; |
| + |
| + bool isNative(ClassElement element) => _backend.isNative(element); |
| + |
| + bool isJsInterop(FunctionElement element) => _backend.isJsInterop(element); |
| + |
| + bool isJsInteropAnonymous(FunctionElement element) => |
| + _backend.jsInteropAnalysis.hasAnonymousAnnotation(element.contextClass); |
| + |
| + String getJsInteropTargetPath(FunctionElement element) { |
| + return '${_backend.namer.fixedBackendPath(element)}.' |
| + '${_backend.getFixedBackendName(element)}'; |
| + } |
| + |
| + DartType get jsJavascriptObjectType => |
| + _backend.helpers.jsJavaScriptObjectClass.thisType; |
| } |