| Index: pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
|
| index a681f7685c27c208b708866c4b1a6153cba43c81..d27b4e28434cd1575e7bd2daf719199faa956381 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart
|
| @@ -143,6 +143,7 @@ jsAst.Expression getReflectionDataParser(OldEmitter oldEmitter,
|
| 'metadata': metadataAccess,
|
| 'notInCspMode': !compiler.useContentSecurityPolicy});
|
|
|
| + // TODO(zarah): Remove empty else branches in output when if(#hole) is false.
|
| jsAst.Statement processStatics = js.statement('''
|
| function processStatics(descriptor, processedClasses) {
|
| for (var property in descriptor) {
|
| @@ -173,8 +174,10 @@ jsAst.Expression getReflectionDataParser(OldEmitter oldEmitter,
|
| functions.push(property);
|
| #globalFunctions[property] = element;
|
| } else if (element.constructor === Array) {
|
| - addStubs(globalObject, element, property,
|
| - true, descriptor, functions);
|
| + if (#needsArrayInitializerSupport) {
|
| + addStubs(globalObject, element, property,
|
| + true, descriptor, functions);
|
| + }
|
| } else {
|
| // We will not enter this case if no classes are defined.
|
| if (#hasClasses) {
|
| @@ -186,7 +189,8 @@ jsAst.Expression getReflectionDataParser(OldEmitter oldEmitter,
|
| }
|
| ''', {'typeInformation': typeInformationAccess,
|
| 'globalFunctions': globalFunctionsAccess,
|
| - 'hasClasses': oldEmitter.needsClassSupport});
|
| + 'hasClasses': oldEmitter.needsClassSupport,
|
| + 'needsArrayInitializerSupport': oldEmitter.needsArrayInitializerSupport});
|
|
|
|
|
| /**
|
| @@ -432,8 +436,10 @@ function $parseReflectionDataName(reflectionData) {
|
| #processClassData;
|
| }
|
| #processStatics;
|
| - #addStubs;
|
| - #tearOffCode;
|
| + if (#needsArrayInitializerSupport) {
|
| + #addStubs;
|
| + #tearOffCode;
|
| + }
|
| #incrementalSupport;
|
| #init;
|
| }''', {
|
| @@ -447,7 +453,8 @@ function $parseReflectionDataName(reflectionData) {
|
| 'tearOffCode': tearOffCode,
|
| 'init': init,
|
| 'finishClasses': finishClasses,
|
| - 'needsClassSupport': oldEmitter.needsClassSupport});
|
| + 'needsClassSupport': oldEmitter.needsClassSupport,
|
| + 'needsArrayInitializerSupport': oldEmitter.needsArrayInitializerSupport});
|
| }
|
|
|
|
|
|
|