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

Side by Side Diff: lib/compiler/implementation/js_backend/emitter.dart

Issue 10879003: Const variables handled as final (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment shortened Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * A function element that represents a closure call. The signature is copied 6 * A function element that represents a closure call. The signature is copied
7 * from the given element. 7 * from the given element.
8 */ 8 */
9 class ClosureInvocationElement extends FunctionElement { 9 class ClosureInvocationElement extends FunctionElement {
10 ClosureInvocationElement(SourceString name, 10 ClosureInvocationElement(SourceString name,
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 385 }
386 } 386 }
387 387
388 bool instanceFieldNeedsGetter(Element member) { 388 bool instanceFieldNeedsGetter(Element member) {
389 assert(member.kind === ElementKind.FIELD); 389 assert(member.kind === ElementKind.FIELD);
390 return compiler.codegenWorld.hasInvokedGetter(member, compiler); 390 return compiler.codegenWorld.hasInvokedGetter(member, compiler);
391 } 391 }
392 392
393 bool instanceFieldNeedsSetter(Element member) { 393 bool instanceFieldNeedsSetter(Element member) {
394 assert(member.kind === ElementKind.FIELD); 394 assert(member.kind === ElementKind.FIELD);
395 return (member.modifiers === null || !member.modifiers.isFinal()) 395 return (member.modifiers === null || !member.modifiers.isFinalOrConst())
396 && compiler.codegenWorld.hasInvokedSetter(member, compiler); 396 && compiler.codegenWorld.hasInvokedSetter(member, compiler);
397 } 397 }
398 398
399 String compiledFieldName(Element member) { 399 String compiledFieldName(Element member) {
400 assert(member.kind === ElementKind.FIELD); 400 assert(member.kind === ElementKind.FIELD);
401 return member.isNative() 401 return member.isNative()
402 ? member.name.slowToString() 402 ? member.name.slowToString()
403 : namer.getName(member); 403 : namer.getName(member);
404 } 404 }
405 405
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 sourceName = token.slowToString(); 1167 sourceName = token.slowToString();
1168 } 1168 }
1169 int totalOffset = bufferOffset + offset; 1169 int totalOffset = bufferOffset + offset;
1170 sourceMapBuilder.addMapping( 1170 sourceMapBuilder.addMapping(
1171 sourceFile, token.charOffset, sourceName, totalOffset); 1171 sourceFile, token.charOffset, sourceName, totalOffset);
1172 }); 1172 });
1173 } 1173 }
1174 } 1174 }
1175 1175
1176 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); 1176 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698