Path: blob/main/test/browser/separate_metadata_later.cpp
4150 views
// Copyright 2018 The Emscripten Authors. All rights reserved.1// Emscripten is available under two separate licenses, the MIT license and the2// University of Illinois/NCSA Open Source License. Both these licenses can be3// found in the LICENSE file.45#include <emscripten.h>67EMSCRIPTEN_KEEPALIVE extern "C" void finish() {8REPORT_RESULT(1);9}1011int main() {12EM_ASM({13setTimeout(function() {14// hijack run dep logic to see when the metadata is loaded ok.15var real = Module["removeRunDependency"];16Module["removeRunDependency"] = function(id) {17real(id);18if (id === "more.js.metadata") {19Module["_finish"]();20}21};22function loadChildScript(name, then) {23var js = document.createElement("script");24if (then) js.onload = then;25js.src = name;26document.body.appendChild(js);27}28loadChildScript("more.js");29}, 1);30});31}32333435