| 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 29179732ad5ca4f84339c73d26e2ad63d7b6818b..eaeba2b26ada7d1aa097206b0ec27481669a3244 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
|
| @@ -140,6 +140,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) {
|
| @@ -170,8 +171,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) {
|
| @@ -183,7 +186,8 @@ jsAst.Expression getReflectionDataParser(OldEmitter oldEmitter,
|
| }
|
| ''', {'typeInformation': typeInformationAccess,
|
| 'globalFunctions': globalFunctionsAccess,
|
| - 'hasClasses': oldEmitter.needsClassSupport});
|
| + 'hasClasses': oldEmitter.needsClassSupport,
|
| + 'needsArrayInitializerSupport': oldEmitter.needsArrayInitializerSupport});
|
|
|
|
|
| /**
|
| @@ -429,8 +433,10 @@ jsAst.Expression getReflectionDataParser(OldEmitter oldEmitter,
|
| #processClassData;
|
| }
|
| #processStatics;
|
| - #addStubs;
|
| - #tearOffCode;
|
| + if (#needsArrayInitializerSupport) {
|
| + #addStubs;
|
| + #tearOffCode;
|
| + }
|
| #incrementalSupport;
|
| #init;
|
| })''', {
|
| @@ -444,7 +450,8 @@ jsAst.Expression getReflectionDataParser(OldEmitter oldEmitter,
|
| 'tearOffCode': tearOffCode,
|
| 'init': init,
|
| 'finishClasses': finishClasses,
|
| - 'needsClassSupport': oldEmitter.needsClassSupport});
|
| + 'needsClassSupport': oldEmitter.needsClassSupport,
|
| + 'needsArrayInitializerSupport': oldEmitter.needsArrayInitializerSupport});
|
| }
|
|
|
|
|
|
|