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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 80chars. Created 8 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
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 part of js_backend; 5 part of js_backend;
6 6
7 class NativeEmitter { 7 class NativeEmitter {
8 8
9 CodeEmitterTask emitter; 9 CodeEmitterTask emitter;
10 CodeBuffer nativeBuffer; 10 CodeBuffer nativeBuffer;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 String get defineNativeClassFunction { 98 String get defineNativeClassFunction {
99 return """ 99 return """
100 function(cls, desc) { 100 function(cls, desc) {
101 var fields = desc[''] || []; 101 var fields = desc[''] || [];
102 var generateGetterSetter = ${emitter.generateGetterSetterFunction}; 102 var generateGetterSetter = ${emitter.generateGetterSetterFunction};
103 for (var i = 0; i < fields.length; i++) { 103 for (var i = 0; i < fields.length; i++) {
104 generateGetterSetter(fields[i], desc); 104 generateGetterSetter(fields[i], desc);
105 } 105 }
106 var hasOwnProperty = Object.prototype.hasOwnProperty; 106 var hasOwnProperty = Object.prototype.hasOwnProperty;
107 for (var method in desc) { 107 for (var method in desc) {
108 if (method !== '') { 108 if (method != '') {
Lasse Reichstein Nielsen 2012/11/12 13:10:41 .isEmpty.
floitsch 2012/11/12 22:18:43 Actually inside a string (thus JavaScript code). R
109 if (hasOwnProperty.call(desc, method)) { 109 if (hasOwnProperty.call(desc, method)) {
110 $dynamicName(method)[cls] = desc[method]; 110 $dynamicName(method)[cls] = desc[method];
111 } 111 }
112 } 112 }
113 } 113 }
114 }"""; 114 }""";
115 } 115 }
116 116
117 void generateNativeLiteral(ClassElement classElement) { 117 void generateNativeLiteral(ClassElement classElement) {
118 String quotedNative = classElement.nativeName.slowToString(); 118 String quotedNative = classElement.nativeName.slowToString();
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 if (!first) targetBuffer.add(",\n"); 475 if (!first) targetBuffer.add(",\n");
476 targetBuffer.add(" $name: $function"); 476 targetBuffer.add(" $name: $function");
477 first = false; 477 first = false;
478 }); 478 });
479 targetBuffer.add("\n});\n\n"); 479 targetBuffer.add("\n});\n\n");
480 } 480 }
481 targetBuffer.add(nativeBuffer); 481 targetBuffer.add(nativeBuffer);
482 targetBuffer.add('\n'); 482 targetBuffer.add('\n');
483 } 483 }
484 } 484 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698