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

Side by Side Diff: sdk/lib/js_util/dartium/js_util_dartium.dart

Issue 2311563002: dart:js_util - fix spelling (Closed)
Patch Set: dart:js_util - fix spelling Created 4 years, 3 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/js_util/dart2js/js_util_dart2js.dart ('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;
11 11
12 import 'dart:js'; 12 import 'dart:js';
13 13
14 /// WARNING: performance of this method is much worse than other uitil 14 /// WARNING: performance of this method is much worse than other util
15 /// methods in this library. Only use this method as a last resort. 15 /// methods in this library. Only use this method as a last resort.
16 /// 16 ///
17 /// Recursively converts a JSON-like collection of Dart objects to a 17 /// Recursively converts a JSON-like collection of Dart objects to a
18 /// collection of JavaScript objects and returns a [JsObject] proxy to it. 18 /// collection of JavaScript objects and returns a [JsObject] proxy to it.
19 /// 19 ///
20 /// [object] must be a [Map] or [Iterable], the contents of which are also 20 /// [object] must be a [Map] or [Iterable], the contents of which are also
21 /// converted. Maps and Iterables are copied to a new JavaScript object. 21 /// converted. Maps and Iterables are copied to a new JavaScript object.
22 /// Primitives and other transferrable values are directly converted to their 22 /// Primitives and other transferable values are directly converted to their
23 /// JavaScript type, and all other objects are proxied. 23 /// JavaScript type, and all other objects are proxied.
24 jsify(object) { 24 jsify(object) {
25 if ((object is! Map) && (object is! Iterable)) { 25 if ((object is! Map) && (object is! Iterable)) {
26 throw new ArgumentError("object must be a Map or Iterable"); 26 throw new ArgumentError("object must be a Map or Iterable");
27 } 27 }
28 return JsNative.jsify(object); 28 return JsNative.jsify(object);
29 } 29 }
30 30
31 JSObject newObject() => JsNative.newObject(); 31 JSObject newObject() => JsNative.newObject();
32 32
33 hasProperty(JSObject o, name) => JsNative.hasProperty(o, name); 33 hasProperty(JSObject o, name) => JsNative.hasProperty(o, name);
34 getProperty(JSObject o, name) => JsNative.getProperty(o, name); 34 getProperty(JSObject o, name) => JsNative.getProperty(o, name);
35 setProperty(JSObject o, name, value) => JsNative.setProperty(o, name, value); 35 setProperty(JSObject o, name, value) => JsNative.setProperty(o, name, value);
36 callMethod(JSObject o, String method, List args) => JsNative.callMethod(o, metho d, args); 36 callMethod(JSObject o, String method, List args) => JsNative.callMethod(o, metho d, args);
37 instanceof(JSObject o, Function type) => JsNative.instanceof(o, type); 37 instanceof(JSObject o, Function type) => JsNative.instanceof(o, type);
38 callConstructor(JSObject constructor, List args) => JsNative.callConstructor(con structor, args); 38 callConstructor(JSObject constructor, List args) => JsNative.callConstructor(con structor, args);
OLDNEW
« no previous file with comments | « sdk/lib/js_util/dart2js/js_util_dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698