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

Side by Side Diff: lib/compiler/implementation/lib/native_helper.dart

Issue 10668021: Distinguish statement and expression foreign code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: After rebase no need for parenthesis anymore. Created 8 years, 6 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 String typeNameInChrome(obj) { 5 String typeNameInChrome(obj) {
6 String name = JS('String', "#.constructor.name", obj); 6 String name = JS('String', "#.constructor.name", obj);
7 if (name == 'Window') return 'DOMWindow'; 7 if (name == 'Window') return 'DOMWindow';
8 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; 8 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
9 return name; 9 return name;
10 } 10 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 String toStringForNativeObject(var obj) { 95 String toStringForNativeObject(var obj) {
96 return 'Instance of ${getTypeNameOf(obj)}'; 96 return 'Instance of ${getTypeNameOf(obj)}';
97 } 97 }
98 98
99 /** 99 /**
100 * Sets a JavaScript property on an object. 100 * Sets a JavaScript property on an object.
101 */ 101 */
102 void defineProperty(var obj, String property, var value) { 102 void defineProperty(var obj, String property, var value) {
103 JS('void', """Object.defineProperty(#, #, 103 JS('void', """Object.defineProperty(#, #,
104 {value: #, enumerable: false, writable: true, configurable: true});""", 104 {value: #, enumerable: false, writable: true, configurable: true})""",
105 obj, 105 obj,
106 property, 106 property,
107 value); 107 value);
108 } 108 }
109 109
110 /** 110 /**
111 * Helper method to throw a [NoSuchMethodException] for a invalid call 111 * Helper method to throw a [NoSuchMethodException] for a invalid call
112 * on a native object. 112 * on a native object.
113 */ 113 */
114 void throwNoSuchMethod(obj, name, arguments) { 114 void throwNoSuchMethod(obj, name, arguments) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 return result; 278 return result;
279 } 279 }
280 280
281 /** 281 /**
282 * Called by the compiler to setup [_dynamicMetadata]. 282 * Called by the compiler to setup [_dynamicMetadata].
283 */ 283 */
284 void dynamicSetMetadata(List<List<String>> inputTable) { 284 void dynamicSetMetadata(List<List<String>> inputTable) {
285 _dynamicMetadata = buildDynamicMetadata(inputTable); 285 _dynamicMetadata = buildDynamicMetadata(inputTable);
286 } 286 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/native_handler.dart » ('j') | lib/compiler/implementation/ssa/nodes.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698