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

Side by Side Diff: lib/html/src/dart2js_IDBKeyRangeFactoryProvider.dart

Issue 11094082: Convert legacy 'native code' to JS-forms in dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 8 years, 2 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
« no previous file with comments | « lib/html/src/dart2js_FactoryProviders.dart ('k') | lib/html/src/dart2js_LocationWrapper.dart » ('j') | 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) 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 class _IDBKeyRangeFactoryProvider { 5 class _IDBKeyRangeFactoryProvider {
6 6
7 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) => 7 static IDBKeyRange createIDBKeyRange_only(/*IDBKey*/ value) =>
8 _only(_class(), _translateKey(value)); 8 _only(_class(), _translateKey(value));
9 9
10 static IDBKeyRange createIDBKeyRange_lowerBound( 10 static IDBKeyRange createIDBKeyRange_lowerBound(
11 /*IDBKey*/ bound, [bool open = false]) => 11 /*IDBKey*/ bound, [bool open = false]) =>
12 _lowerBound(_class(), _translateKey(bound), open); 12 _lowerBound(_class(), _translateKey(bound), open);
13 13
14 static IDBKeyRange createIDBKeyRange_upperBound( 14 static IDBKeyRange createIDBKeyRange_upperBound(
15 /*IDBKey*/ bound, [bool open = false]) => 15 /*IDBKey*/ bound, [bool open = false]) =>
16 _upperBound(_class(), _translateKey(bound), open); 16 _upperBound(_class(), _translateKey(bound), open);
17 17
18 static IDBKeyRange createIDBKeyRange_bound(/*IDBKey*/ lower, /*IDBKey*/ upper, 18 static IDBKeyRange createIDBKeyRange_bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
19 [bool lowerOpen = false, bool upperOpen = false]) => 19 [bool lowerOpen = false, bool upperOpen = false]) =>
20 _bound(_class(), _translateKey(lower), _translateKey(upper), 20 _bound(_class(), _translateKey(lower), _translateKey(upper),
21 lowerOpen, upperOpen); 21 lowerOpen, upperOpen);
22 22
23 static var _cachedClass; 23 static var _cachedClass;
24 24
25 static _class() { 25 static _class() {
26 if (_cachedClass != null) return _cachedClass; 26 if (_cachedClass != null) return _cachedClass;
27 return _cachedClass = _uncachedClass(); 27 return _cachedClass = _uncachedClass();
28 } 28 }
29 29
30 static _uncachedClass() native ''' 30 static _uncachedClass() =>
31 return window.webkitIDBKeyRange || window.mozIDBKeyRange || 31 JS('var',
32 window.msIDBKeyRange || window.IDBKeyRange; 32 '''window.webkitIDBKeyRange || window.mozIDBKeyRange ||
33 '''; 33 window.msIDBKeyRange || window.IDBKeyRange''');
34 34
35 static _translateKey(idbkey) => idbkey; // TODO: fixme. 35 static _translateKey(idbkey) => idbkey; // TODO: fixme.
36 36
37 static _IDBKeyRangeImpl _only(cls, value) native 37 static _IDBKeyRangeImpl _only(cls, value) =>
38 '''return cls.only(value);'''; 38 JS('_IDBKeyRangeImpl', '#.only(#)', cls, value);
39 39
40 static _IDBKeyRangeImpl _lowerBound(cls, bound, open) native 40 static _IDBKeyRangeImpl _lowerBound(cls, bound, open) =>
41 '''return cls.lowerBound(bound, open);'''; 41 JS('_IDBKeyRangeImpl', '#.lowerBound(#, #)', cls, bound, open);
42 42
43 static _IDBKeyRangeImpl _upperBound(cls, bound, open) native 43 static _IDBKeyRangeImpl _upperBound(cls, bound, open) =>
44 '''return cls.upperBound(bound, open);'''; 44 JS('_IDBKeyRangeImpl', '#.upperBound(#, #)', cls, bound, open);
45 45
46 static _IDBKeyRangeImpl _bound(cls, lower, upper, lowerOpen, upperOpen) native 46 static _IDBKeyRangeImpl _bound(cls, lower, upper, lowerOpen, upperOpen) =>
47 '''return cls.bound(lower, upper, lowerOpen, upperOpen);'''; 47 JS('_IDBKeyRangeImpl', '#.bound(#, #, #, #)',
48 48 cls, lower, upper, lowerOpen, upperOpen);
49 } 49 }
OLDNEW
« no previous file with comments | « lib/html/src/dart2js_FactoryProviders.dart ('k') | lib/html/src/dart2js_LocationWrapper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698