You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Data requests - for getting a block of data out of the big archive - have
700
698
# a similar API to XHRs
701
699
code+='''
702
-
/** @constructor */
703
-
function DataRequest(start, end) {
704
-
this.start = start;
705
-
this.end = end;
706
-
}
707
-
DataRequest.prototype = {
708
-
requests: {},
709
-
open: function(mode, name) {
710
-
this.name = name;
711
-
this.requests[name] = this;
712
-
Module['addRunDependency'](`fp ${this.name}`);
713
-
},
714
-
send: function() {},
715
-
onload: function() {
716
-
var byteArray = this.byteArray.subarray(this.start, this.end);
717
-
this.finish(byteArray);
718
-
},
719
-
finish: async function(byteArray) {
720
-
var that = this;
721
-
%s
722
-
this.requests[this.name] = null;
723
-
}
724
-
};
725
-
726
-
var files = metadata['files'];
727
-
for (var i = 0; i < files.length; ++i) {
728
-
new DataRequest(files[i]['start'], files[i]['end']).open('GET', files[i]['filename']);
729
-
}\n'''%finish_handler
700
+
for (var file of metadata['files']) {
701
+
var name = file['filename']
702
+
Module['addRunDependency'](`fp ${name}`);
703
+
}\n'''
730
704
731
705
ifoptions.has_embeddedandnotoptions.obj_output:
732
706
diagnostics.warn('--obj-output is recommended when using --embed. This outputs an object file for linking directly into your application is more efficient than JS encoding')
0 commit comments