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

Side by Side Diff: lib/runtime/dart/js.js

Issue 1484263002: Use destructuring assignments for named parameters (#180) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Destructure function params directly (no more opts in most cases) Created 5 years 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
OLDNEW
1 dart_library.library('dart/js', null, /* Imports */[ 1 dart_library.library('dart/js', null, /* Imports */[
2 "dart/_runtime", 2 "dart/_runtime",
3 'dart/core', 3 'dart/core',
4 'dart/collection', 4 'dart/collection',
5 'dart/_js_helper' 5 'dart/_js_helper'
6 ], /* Lazy imports */[ 6 ], /* Lazy imports */[
7 ], function(exports, dart, core, collection, _js_helper) { 7 ], function(exports, dart, core, collection, _js_helper) {
8 'use strict'; 8 'use strict';
9 let dartx = dart.dartx; 9 let dartx = dart.dartx;
10 dart.defineLazyProperties(exports, { 10 dart.defineLazyProperties(exports, {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 let args = [_convertToDart(this)]; 146 let args = [_convertToDart(this)];
147 for (let arg of arguments) { 147 for (let arg of arguments) {
148 args.push(_convertToDart(arg)); 148 args.push(_convertToDart(arg));
149 } 149 }
150 return _convertToJS(f(...args)); 150 return _convertToJS(f(...args));
151 }); 151 });
152 } 152 }
153 _fromJs(jsObject) { 153 _fromJs(jsObject) {
154 super._fromJs(jsObject); 154 super._fromJs(jsObject);
155 } 155 }
156 apply(args, opts) { 156 apply(args, {thisArg = null} = {}) {
157 let thisArg = opts && 'thisArg' in opts ? opts.thisArg : null;
158 return _convertToDart(this[_jsObject].apply(_convertToJS(thisArg), args == null ? null : core.List.from(args[dartx.map](_convertToJS)))); 157 return _convertToDart(this[_jsObject].apply(_convertToJS(thisArg), args == null ? null : core.List.from(args[dartx.map](_convertToJS))));
159 } 158 }
160 } 159 }
161 dart.defineNamedConstructor(JsFunction, '_fromJs'); 160 dart.defineNamedConstructor(JsFunction, '_fromJs');
162 dart.setSignature(JsFunction, { 161 dart.setSignature(JsFunction, {
163 constructors: () => ({ 162 constructors: () => ({
164 withThis: [JsFunction, [core.Function]], 163 withThis: [JsFunction, [core.Function]],
165 _fromJs: [JsFunction, [dart.dynamic]] 164 _fromJs: [JsFunction, [dart.dynamic]]
166 }), 165 }),
167 methods: () => ({apply: [dart.dynamic, [core.List], {thisArg: dart.dynamic}] }) 166 methods: () => ({apply: [dart.dynamic, [core.List], {thisArg: dart.dynamic}] })
168 }); 167 });
169 let _checkIndex = Symbol('_checkIndex'); 168 let _checkIndex = Symbol('_checkIndex');
170 let _checkInsertIndex = Symbol('_checkInsertIndex'); 169 let _checkInsertIndex = Symbol('_checkInsertIndex');
171 let JsArray$ = dart.generic(function(E) { 170 let JsArray$ = dart.generic(function(E) {
172 class JsArray extends dart.mixin(JsObject, collection.ListMixin$(E)) { 171 class JsArray extends dart.mixin(JsObject, collection.ListMixin$(E)) {
173 JsArray() { 172 JsArray() {
174 super._fromJs([]); 173 super._fromJs([]);
175 } 174 }
176 from(other) { 175 from(other) {
177 super._fromJs((() => { 176 super._fromJs((() => {
178 let _ = []; 177 let _ = [];
179 _[dartx.addAll](other[dartx.map](dart.as(_convertToJS, __CastType0))); 178 _[dartx.addAll](other[dartx.map](dart.as(_convertToJS, __CastType0$(E) )));
180 return _; 179 return _;
181 })()); 180 })());
182 } 181 }
183 _fromJs(jsObject) { 182 _fromJs(jsObject) {
184 super._fromJs(jsObject); 183 super._fromJs(jsObject);
185 } 184 }
186 [_checkIndex](index) { 185 [_checkIndex](index) {
187 if (typeof index == 'number' && (dart.notNull(index) < 0 || dart.notNull (index) >= dart.notNull(this.length))) { 186 if (typeof index == 'number' && (dart.notNull(index) < 0 || dart.notNull (index) >= dart.notNull(this.length))) {
188 dart.throw(new core.RangeError.range(index, 0, this.length)); 187 dart.throw(new core.RangeError.range(index, 0, this.length));
189 } 188 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 }); 420 });
422 let __CastType0 = __CastType0$(); 421 let __CastType0 = __CastType0$();
423 // Exports: 422 // Exports:
424 exports.JsObject = JsObject; 423 exports.JsObject = JsObject;
425 exports.JsFunction = JsFunction; 424 exports.JsFunction = JsFunction;
426 exports.JsArray$ = JsArray$; 425 exports.JsArray$ = JsArray$;
427 exports.JsArray = JsArray; 426 exports.JsArray = JsArray;
428 exports.allowInterop = allowInterop; 427 exports.allowInterop = allowInterop;
429 exports.allowInteropCaptureThis = allowInteropCaptureThis; 428 exports.allowInteropCaptureThis = allowInteropCaptureThis;
430 }); 429 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698