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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart

Issue 1540973005: dart2js: minify 'static:' tag (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart2js.js_emitter.full_emitter; 5 part of dart2js.js_emitter.full_emitter;
6 6
7 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 8
9 ClassStubGenerator get _stubGenerator => 9 ClassStubGenerator get _stubGenerator =>
10 new ClassStubGenerator(compiler, namer, backend); 10 new ClassStubGenerator(compiler, namer, backend);
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 322
323 // TODO(herhut): Do not grab statics out of the properties. 323 // TODO(herhut): Do not grab statics out of the properties.
324 ClassBuilder classProperties = 324 ClassBuilder classProperties =
325 emitter.elementDescriptors[fragment].remove(classElement); 325 emitter.elementDescriptors[fragment].remove(classElement);
326 if (classProperties != null) { 326 if (classProperties != null) {
327 statics.addAll(classProperties.properties); 327 statics.addAll(classProperties.properties);
328 } 328 }
329 329
330 if (!statics.isEmpty) { 330 if (!statics.isEmpty) {
331 classBuilder.addPropertyByName( 331 classBuilder.addProperty(
332 'static', 332 namer.staticsPropertyName, // 'static' or its minified name.
333 new jsAst.ObjectInitializer(statics, isOneLiner: false)); 333 new jsAst.ObjectInitializer(statics, isOneLiner: false));
334 } 334 }
335 335
336 // TODO(ahe): This method (generateClass) should return a jsAst.Expression. 336 // TODO(ahe): This method (generateClass) should return a jsAst.Expression.
337 jsAst.ObjectInitializer propertyValue = 337 jsAst.ObjectInitializer propertyValue =
338 classBuilder.toObjectInitializer(); 338 classBuilder.toObjectInitializer();
339 compiler.dumpInfoTask.registerElementAst(classBuilder.element, propertyValue ); 339 compiler.dumpInfoTask.registerElementAst(classBuilder.element, propertyValue );
340 enclosingBuilder.addProperty(className, propertyValue); 340 enclosingBuilder.addProperty(className, propertyValue);
341 341
342 String reflectionName = emitter.getReflectionName(classElement, className); 342 String reflectionName = emitter.getReflectionName(classElement, className);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 : new Selector.setter( 427 : new Selector.setter(
428 new Name(member.name, member.library, isSetter: true)); 428 new Name(member.name, member.library, isSetter: true));
429 String reflectionName = emitter.getReflectionName(selector, name); 429 String reflectionName = emitter.getReflectionName(selector, name);
430 if (reflectionName != null) { 430 if (reflectionName != null) {
431 var reflectable = 431 var reflectable =
432 js(backend.isAccessibleByReflection(member) ? '1' : '0'); 432 js(backend.isAccessibleByReflection(member) ? '1' : '0');
433 builder.addPropertyByName('+$reflectionName', reflectable); 433 builder.addPropertyByName('+$reflectionName', reflectable);
434 } 434 }
435 } 435 }
436 } 436 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/js_emitter/full_emitter/setup_program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698