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

Side by Side Diff: lib/dom/src/frog_IDBKeyRangeFactoryProvider.dart

Issue 10142001: Revert "Constructors for IDBKeyRange" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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/dom/src/dummy_FactoryProviders.dart ('k') | lib/dom/src/native_FactoryProviders.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class _IDBKeyRangeFactoryProvider {
6
7 factory IDBKeyRange.only(/*IDBKey*/ value) =>
8 _only(_class(), _translateKey(value));
9
10 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) =>
11 _lowerBound(_class(), _translateKey(bound), open);
12
13 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) =>
14 _upperBound(_class(), _translateKey(bound), open);
15
16 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
17 [bool lowerOpen = false, bool upperOpen = false]) =>
18 _bound(_class(), _translateKey(lower), _translateKey(upper),
19 lowerOpen, upperOpen);
20
21 static var _cachedClass;
22
23 static _class() {
24 if (_cachedClass != null) return _cachedClass;
25 return _cachedClass = _uncachedClass();
26 }
27
28 static _uncachedClass() native '''
29 return window.webkitIDBKeyRange || window.mozIDBKeyRange ||
30 window.msIDBKeyRange || window.IDBKeyRange;
31 ''';
32
33 static _translateKey(idbkey) => idbkey; // TODO: fixme.
34
35 static _IDBKeyRangeJs _only(cls, value) native
36 '''return cls.only(value);''';
37
38 static _IDBKeyRangeJs _lowerBound(cls, bound, open) native
39 '''return cls.lowerBound(bound, open);''';
40
41 static _IDBKeyRangeJs _upperBound(cls, bound, open) native
42 '''return cls.upperBound(bound, open);''';
43
44 static _IDBKeyRangeJs _bound(cls, lower, upper, lowerOpen, upperOpen) native
45 '''return cls.bound(lower, upper, lowerOpen, upperOpen);''';
46
47 }
OLDNEW
« no previous file with comments | « lib/dom/src/dummy_FactoryProviders.dart ('k') | lib/dom/src/native_FactoryProviders.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698