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

Side by Side Diff: sdk/lib/js_util/dart2js/js_util_dart2js.dart

Issue 2186433002: TBR. Shouldn't have referenced JSObject in dart2js. Accidentally left it in porting code from darti… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Removing js_util from this list makes the platform consistency test pass but that seems like the wr… Created 4 years, 5 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
« no previous file with comments | « sdk/lib/dart_shared.platform ('k') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /// Utility methods to efficiently manipulate typed JSInterop objects in cases 5 /// Utility methods to efficiently manipulate typed JSInterop objects in cases
6 /// where the name to call is not known at runtime. You should only use these 6 /// where the name to call is not known at runtime. You should only use these
7 /// methods when the same effect cannot be achieved with @JS annotations. 7 /// methods when the same effect cannot be achieved with @JS annotations.
8 /// These methods would be extension methods on JSObject if Dart supported 8 /// These methods would be extension methods on JSObject if Dart supported
9 /// extension methods. 9 /// extension methods.
10 library dart.js_util; 10 library dart.js_util;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 convertedList.addAll(o.map(_convert)); 49 convertedList.addAll(o.map(_convert));
50 return convertedList; 50 return convertedList;
51 } else { 51 } else {
52 return o; 52 return o;
53 } 53 }
54 } 54 }
55 55
56 return _convert(data); 56 return _convert(data);
57 } 57 }
58 58
59 JSObject newObject() => JS('=Object', '{}'); 59 newObject() => JS('=Object', '{}');
60 60
61 hasProperty(o, name) => JS('bool', '# in #', name, o); 61 hasProperty(o, name) => JS('bool', '# in #', name, o);
62 getProperty(o, name) => JS('Object', '#[#]', o, name); 62 getProperty(o, name) => JS('Object', '#[#]', o, name);
63 setProperty(o, name, value) => JS('', '#[#]=#', o, name, value); 63 setProperty(o, name, value) => JS('', '#[#]=#', o, name, value);
64 64
65 callMethod(o, String method, List args) => 65 callMethod(o, String method, List args) =>
66 JS('Object', '#[#].apply(#, #)', o, method, o, args); 66 JS('Object', '#[#].apply(#, #)', o, method, o, args);
67 67
68 instanceof(o, Function type) => JS('bool', '# instanceof #', o, type); 68 instanceof(o, Function type) => JS('bool', '# instanceof #', o, type);
69 callConstructor(Function constr, List arguments) { 69 callConstructor(Function constr, List arguments) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // object for which there is an interceptor 117 // object for which there is an interceptor
118 return JS('Object', 'new #()', factoryFunction); 118 return JS('Object', 'new #()', factoryFunction);
119 119
120 // TODO(sra): Investigate: 120 // TODO(sra): Investigate:
121 // 121 //
122 // var jsObj = JS('', 'Object.create(#.prototype)', constr); 122 // var jsObj = JS('', 'Object.create(#.prototype)', constr);
123 // JS('', '#.apply(#, #)', constr, jsObj, 123 // JS('', '#.apply(#, #)', constr, jsObj,
124 // []..addAll(arguments.map(_convertToJS))); 124 // []..addAll(arguments.map(_convertToJS)));
125 // return _wrapToDart(jsObj); 125 // return _wrapToDart(jsObj);
126 } 126 }
OLDNEW
« no previous file with comments | « sdk/lib/dart_shared.platform ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698