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

Side by Side Diff: lib/runtime/dart/_js_helper.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_helper', null, /* Imports */[ 1 dart_library.library('dart/_js_helper', null, /* Imports */[
2 "dart/_runtime", 2 "dart/_runtime",
3 'dart/core', 3 'dart/core',
4 'dart/collection', 4 'dart/collection',
5 'dart/_interceptors', 5 'dart/_interceptors',
6 'dart/_foreign_helper' 6 'dart/_foreign_helper'
7 ], /* Lazy imports */[ 7 ], /* Lazy imports */[
8 ], function(exports, dart, core, collection, _interceptors, _foreign_helper) { 8 ], function(exports, dart, core, collection, _interceptors, _foreign_helper) {
9 'use strict'; 9 'use strict';
10 let dartx = dart.dartx; 10 let dartx = dart.dartx;
(...skipping 13 matching lines...) Expand all
24 }); 24 });
25 class Native extends core.Object { 25 class Native extends core.Object {
26 Native(name) { 26 Native(name) {
27 this.name = name; 27 this.name = name;
28 } 28 }
29 } 29 }
30 dart.setSignature(Native, { 30 dart.setSignature(Native, {
31 constructors: () => ({Native: [Native, [core.String]]}) 31 constructors: () => ({Native: [Native, [core.String]]})
32 }); 32 });
33 class JsPeerInterface extends core.Object { 33 class JsPeerInterface extends core.Object {
34 JsPeerInterface(opts) { 34 JsPeerInterface({name = null} = {}) {
35 let name = opts && 'name' in opts ? opts.name : null;
36 this.name = name; 35 this.name = name;
37 } 36 }
38 } 37 }
39 dart.setSignature(JsPeerInterface, { 38 dart.setSignature(JsPeerInterface, {
40 constructors: () => ({JsPeerInterface: [JsPeerInterface, [], {name: core.Str ing}]}) 39 constructors: () => ({JsPeerInterface: [JsPeerInterface, [], {name: core.Str ing}]})
41 }); 40 });
42 class SupportJsExtensionMethods extends core.Object { 41 class SupportJsExtensionMethods extends core.Object {
43 SupportJsExtensionMethods() { 42 SupportJsExtensionMethods() {
44 } 43 }
45 } 44 }
(...skipping 26 matching lines...) Expand all
72 let _nativeGlobalRegExp = Symbol('_nativeGlobalRegExp'); 71 let _nativeGlobalRegExp = Symbol('_nativeGlobalRegExp');
73 let _nativeAnchoredRegExp = Symbol('_nativeAnchoredRegExp'); 72 let _nativeAnchoredRegExp = Symbol('_nativeAnchoredRegExp');
74 let _isMultiLine = Symbol('_isMultiLine'); 73 let _isMultiLine = Symbol('_isMultiLine');
75 let _isCaseSensitive = Symbol('_isCaseSensitive'); 74 let _isCaseSensitive = Symbol('_isCaseSensitive');
76 let _execGlobal = Symbol('_execGlobal'); 75 let _execGlobal = Symbol('_execGlobal');
77 let _execAnchored = Symbol('_execAnchored'); 76 let _execAnchored = Symbol('_execAnchored');
78 class JSSyntaxRegExp extends core.Object { 77 class JSSyntaxRegExp extends core.Object {
79 toString() { 78 toString() {
80 return `RegExp/${this.pattern}/`; 79 return `RegExp/${this.pattern}/`;
81 } 80 }
82 JSSyntaxRegExp(source, opts) { 81 JSSyntaxRegExp(source, {multiLine = false, caseSensitive = true} = {}) {
83 let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false;
84 let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true;
85 this.pattern = source; 82 this.pattern = source;
86 this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSen sitive, false); 83 this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSen sitive, false);
87 this[_nativeGlobalRegExp] = null; 84 this[_nativeGlobalRegExp] = null;
88 this[_nativeAnchoredRegExp] = null; 85 this[_nativeAnchoredRegExp] = null;
89 } 86 }
90 get [_nativeGlobalVersion]() { 87 get [_nativeGlobalVersion]() {
91 if (this[_nativeGlobalRegExp] != null) 88 if (this[_nativeGlobalRegExp] != null)
92 return this[_nativeGlobalRegExp]; 89 return this[_nativeGlobalRegExp];
93 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern, this[_isMultiLine], this[_isCaseSensitive], true); 90 return this[_nativeGlobalRegExp] = JSSyntaxRegExp.makeNative(this.pattern, this[_isMultiLine], this[_isCaseSensitive], true);
94 } 91 }
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 exports.CastErrorImplementation = CastErrorImplementation; 1229 exports.CastErrorImplementation = CastErrorImplementation;
1233 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; 1230 exports.FallThroughErrorImplementation = FallThroughErrorImplementation;
1234 exports.RuntimeError = RuntimeError; 1231 exports.RuntimeError = RuntimeError;
1235 exports.random64 = random64; 1232 exports.random64 = random64;
1236 exports.jsonEncodeNative = jsonEncodeNative; 1233 exports.jsonEncodeNative = jsonEncodeNative;
1237 exports.SyncIterator$ = SyncIterator$; 1234 exports.SyncIterator$ = SyncIterator$;
1238 exports.SyncIterator = SyncIterator; 1235 exports.SyncIterator = SyncIterator;
1239 exports.SyncIterable$ = SyncIterable$; 1236 exports.SyncIterable$ = SyncIterable$;
1240 exports.SyncIterable = SyncIterable; 1237 exports.SyncIterable = SyncIterable;
1241 }); 1238 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698