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

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

Issue 11691009: Moved most of html lib generating scripts into tools. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
1 static Blob _create([List blobParts = null, String type, String endings]) { 1 static Blob _create([List blobParts = null, String type, String endings]) {
2 // TODO: validate that blobParts is a JS Array and convert if not. 2 // TODO: validate that blobParts is a JS Array and convert if not.
3 // TODO: any coercions on the elements of blobParts, e.g. coerce a typed 3 // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
4 // array to ArrayBuffer if it is a total view. 4 // array to ArrayBuffer if it is a total view.
5 if (type == null && endings == null) { 5 if (type == null && endings == null) {
6 return _create_1(blobParts); 6 return _create_1(blobParts);
7 } 7 }
8 var bag = _create_bag(); 8 var bag = _create_bag();
9 if (type != null) _bag_set(bag, 'type', type); 9 if (type != null) _bag_set(bag, 'type', type);
10 if (endings != null) _bag_set(bag, 'endings', endings); 10 if (endings != null) _bag_set(bag, 'endings', endings);
11 return _create_2(blobParts, bag); 11 return _create_2(blobParts, bag);
12 } 12 }
13 13
14 static _create_1(parts) => JS('Blob', 'new Blob(#)', parts); 14 static _create_1(parts) => JS('Blob', 'new Blob(#)', parts);
15 static _create_2(parts, bag) => JS('Blob', 'new Blob(#, #)', parts, bag); 15 static _create_2(parts, bag) => JS('Blob', 'new Blob(#, #)', parts, bag);
16 16
17 static _create_bag() => JS('var', '{}'); 17 static _create_bag() => JS('var', '{}');
18 static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); } 18 static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698