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

Side by Side Diff: lib/dom/templates/html/dart2js/factoryprovider_Blob.darttemplate

Issue 10913125: Remove lib/dom directory! (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
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 $FACTORYPROVIDER {
6 factory Blob(List blobParts = null, [String type, String endings]) {
7 // TODO: validate that blobParts is a JS Array and convert if not.
8 // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
9 // array to ArrayBuffer if it is a total view.
10 if (type == null && endings == null) {
11 return _create_1(blobParts);
12 }
13 var bag = _create_bag();
14 if (type != null) _bag_set(bag, 'type', type);
15 if (endings != null) _bag_set(bag, 'endings', endings);
16 return _create_2(blobParts, bag);
17 }
18
19 static _create_1(parts) native 'return new Blob(parts);';
20 static _create_2(parts, bag) native 'return new Blob(parts, bag);';
21
22 static _create_bag() native 'return {}';
23 static _bag_set(bag, key, value) native 'bag[key] = value;';
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698