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

Side by Side Diff: dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 740403003: Restore tmp function (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r41897. Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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; 5 part of dart2js.js_emitter;
6 6
7 7
8 class OldEmitter implements Emitter { 8 class OldEmitter implements Emitter {
9 final Compiler compiler; 9 final Compiler compiler;
10 final CodeEmitterTask task; 10 final CodeEmitterTask task;
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 js('$generateAccessorHolder = generateAccessor'), 305 js('$generateAccessorHolder = generateAccessor'),
306 new jsAst.FunctionDeclaration( 306 new jsAst.FunctionDeclaration(
307 new jsAst.VariableDeclaration('defineClass'), defineClass) ] 307 new jsAst.VariableDeclaration('defineClass'), defineClass) ]
308 ..addAll(saveDefineClass); 308 ..addAll(saveDefineClass);
309 } 309 }
310 310
311 /** Needs defineClass to be defined. */ 311 /** Needs defineClass to be defined. */
312 jsAst.Expression buildInheritFrom() { 312 jsAst.Expression buildInheritFrom() {
313 jsAst.Expression result = js(r''' 313 jsAst.Expression result = js(r'''
314 function() { 314 function() {
315 function tmp() {}
315 var hasOwnProperty = Object.prototype.hasOwnProperty; 316 var hasOwnProperty = Object.prototype.hasOwnProperty;
316 return function (constructor, superConstructor) { 317 return function (constructor, superConstructor) {
317 var object = Object.create(superConstructor.prototype); 318 tmp.prototype = superConstructor.prototype;
319 var object = new tmp();
318 var properties = constructor.prototype; 320 var properties = constructor.prototype;
319 for (var member in properties) { 321 for (var member in properties) {
320 if (hasOwnProperty.call(properties, member)) { 322 if (hasOwnProperty.call(properties, member)) {
321 object[member] = properties[member]; 323 object[member] = properties[member];
322 } 324 }
323 } 325 }
324 object.constructor = constructor; 326 object.constructor = constructor;
325 constructor.prototype = object; 327 constructor.prototype = object;
326 return object; 328 return object;
327 }; 329 };
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2013 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2012 if (element.isInstanceMember) { 2014 if (element.isInstanceMember) {
2013 cachedClassBuilders.remove(element.enclosingClass); 2015 cachedClassBuilders.remove(element.enclosingClass);
2014 2016
2015 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2017 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2016 2018
2017 } 2019 }
2018 } 2020 }
2019 } 2021 }
2020 } 2022 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698