@ai-development-environment/server 0.0.84 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -2
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +3 -3
- package/standalone/.next/node_modules/re2-332e07f5b609c24b/index.cjs +1 -0
- package/standalone/.next/node_modules/re2-332e07f5b609c24b/package.json +4 -0
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/required-server-files.json +3 -2
- package/standalone/.next/server/app/[locale]/(auth)/register/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(auth)/sign-in/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/actions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/actions-cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/agents/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/agents/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/analytics-events/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/api-keys/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/apps/[appId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/apps/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/build-data/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/coverage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/output/route.js +2 -2
- package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/output/route.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/builds/[buildId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/builds/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/changes/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/codebases/[codebaseId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/codebases/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/codebases/repositories/[repositoryId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/commands/[commandId]/edit/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/commands/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/commands/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/output/route.js +2 -2
- package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/output/route.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/commands/runs/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/comments/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/console-logs/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/costs/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/credentials/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/devices/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/devices/enroll/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/devices/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/drafts/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/entries/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/github-cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira/tickets/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira-cache/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jira-webhooks/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/jobs/[jobId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/notifications/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/plans/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/plans/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/polling/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/[profileId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/provisioning-profiles/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/pull-requests/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/push-notifications/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/runs/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/sessions/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/sessions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/settings/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/skills/[skillId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/[groupId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/skills/groups/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/skills/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/skills/sync/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/tools/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/unified-events/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/usage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/users/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/webhooks/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/edit/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/[workflowId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/new/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/workflows/runs/[runId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/[worktreeId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/(dashboard)/worktrees/page.js.nft.json +1 -1
- package/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/standalone/.next/server/app/_global-error.html +1 -1
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js +2 -2
- package/standalone/.next/server/app/api/agent/run-attachments/[attachmentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/config/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/management/api-keys/[keyId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/management/api-keys/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/management/registration/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/management/sessions/[sessionId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/management/users/[userId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/management/users/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/mobile/oauth/complete/route.js +3 -3
- package/standalone/.next/server/app/api/auth/mobile/oauth/complete/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/mobile/oauth/start/route.js +6 -6
- package/standalone/.next/server/app/api/auth/mobile/oauth/start/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/auth/mobile/redeem/route.js +6 -6
- package/standalone/.next/server/app/api/auth/mobile/redeem/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js +2 -2
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/by-path/route.js +2 -2
- package/standalone/.next/server/app/api/codebases/by-path/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/route.js +2 -2
- package/standalone/.next/server/app/api/codebases/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/graphql/route.js +2 -2
- package/standalone/.next/server/app/api/graphql/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/apns-devices/route.js +2 -2
- package/standalone/.next/server/app/api/ios/apns-devices/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/devices/export.tsv/route.js +2 -2
- package/standalone/.next/server/app/api/ios/devices/export.tsv/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/enrollment/start/route.js +2 -2
- package/standalone/.next/server/app/api/ios/enrollment/start/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/ios/notification-devices/route.js +2 -2
- package/standalone/.next/server/app/api/ios/notification-devices/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/mcp/route.js +2 -2
- package/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/openapi.json/route.js +1 -1
- package/standalone/.next/server/app/api/openapi.json/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/manifest.plist/route.js +2 -2
- package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/manifest.plist/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/route.js +2 -2
- package/standalone/.next/server/app/api/public/builds/[buildId]/artifacts/[artifactId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/github/webhook/route.js +2 -2
- package/standalone/.next/server/app/api/public/github/webhook/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/ios/enrollment-complete/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/ios/enrollment-profile/route.js +2 -2
- package/standalone/.next/server/app/api/public/ios/enrollment-profile/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/ios/profile-response/route.js +2 -2
- package/standalone/.next/server/app/api/public/ios/profile-response/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/public/jira/webhook/route.js +2 -2
- package/standalone/.next/server/app/api/public/jira/webhook/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/run-attachments/[attachmentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/run-attachments/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/telemetry/analytics-events/route.js +2 -2
- package/standalone/.next/server/app/api/telemetry/analytics-events/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/telemetry/console-logs/route.js +2 -2
- package/standalone/.next/server/app/api/telemetry/console-logs/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/telemetry/export/route.js +2 -2
- package/standalone/.next/server/app/api/telemetry/export/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/call/route.js +2 -2
- package/standalone/.next/server/app/api/tools/call/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/catalog/route.js +2 -2
- package/standalone/.next/server/app/api/tools/catalog/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/worktrees/[worktreeId]/diff-image/route.js +2 -2
- package/standalone/.next/server/app/api/worktrees/[worktreeId]/diff-image/route.js.nft.json +1 -1
- package/standalone/.next/server/app/icon.svg/route.js.nft.json +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__04i6ibl._.js → [root-of-the-server]__00awghn._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__06e1aai._.js → [root-of-the-server]__01fc8er._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__00xcg2c._.js → [root-of-the-server]__01s43cm._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0-j_rt4._.js → [root-of-the-server]__01xz3y_._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__06gi27i._.js → [root-of-the-server]__021fex_._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__06jhhu1._.js → [root-of-the-server]__028j56p._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0c_sj8k._.js → [root-of-the-server]__04_ohht._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0c9kg5q._.js → [root-of-the-server]__04yufht._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__06uxp7s._.js → [root-of-the-server]__05-fxkh._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__14m_8nc._.js → [root-of-the-server]__06u7pdm._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0072ye-._.js → [root-of-the-server]__06xlh28._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0-hp8gw._.js → [root-of-the-server]__08c82jc._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0712mqb._.js → [root-of-the-server]__08ebgcu._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__16ke6wr._.js → [root-of-the-server]__08lx09f._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__148dtoe._.js → [root-of-the-server]__096mlhl._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__00kj6r7._.js → [root-of-the-server]__09mo3t8._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__10bs2_7._.js → [root-of-the-server]__09svdrb._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__07vyiqy._.js → [root-of-the-server]__0_d2g94._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1-l6iy9._.js → [root-of-the-server]__0al7x4f._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__0c2tkz2._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__05l4mi8._.js → [root-of-the-server]__0c4pqb-._.js} +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__0cj65ti._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__01885qr._.js → [root-of-the-server]__0d3awck._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__09yow0s._.js → [root-of-the-server]__0de_qut._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1x35-d0._.js → [root-of-the-server]__0e31e7p._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__0e53pce._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0ecnp29._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0eldrcp._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0eopc38._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0fo_msa._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0gtwvjk._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0h50ygv._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__00t260s._.js → [root-of-the-server]__0hbjmzn._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__0hffylr._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0hvsuut._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0inac5u._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0jd56xd._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0jjv2dl._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0kbteue._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0le7cki._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0lu8r5i._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0m5alcp._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0mbymp_._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0mi-xpq._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0mx_l8j._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0qkxjnh._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0rgdw1t._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0s_zc22._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0sk_wpl._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0sm_9x3._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0uaej7i._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__09jmuxh._.js → [root-of-the-server]__0v3wyan._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__0wkgq45._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0xbgjwj._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0xsa1ko._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0yg5tbe._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__0zcm8g9._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__1dgyml6._.js → [root-of-the-server]__0zxvn5t._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__18xb4tw._.js → [root-of-the-server]__1-rtc2c._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__10duq79._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__10n9aa8._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__1mmah0v._.js → [root-of-the-server]__124au6p._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__137wgug._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0x8mo8l._.js → [root-of-the-server]__13cy_hd._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__13o2i1b._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1563rfp._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__15p0skc._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__15xfa5d._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__16q8nl1._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__045vcsv._.js → [root-of-the-server]__16ur7du._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__1hlka6s._.js → [root-of-the-server]__17m0i74._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__18crj_k._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0pjluwr._.js → [root-of-the-server]__19c_hrh._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__07sc4d6._.js → [root-of-the-server]__19lnrpb._.js} +3 -3
- package/standalone/.next/server/chunks/{[root-of-the-server]__1vx14af._.js → [root-of-the-server]__19miqxq._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__19o8fio._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__1hxh6f7._.js → [root-of-the-server]__19vmv0l._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__07b7x5c._.js → [root-of-the-server]__1_-bk8a._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1_87r0p._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1_x_z5z._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1a2a4dw._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1ai5a7b._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1aqix91._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1au8rl_._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1awqqwk._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0jrv5rz._.js → [root-of-the-server]__1b92e1t._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1bv5-_8._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1c80jly._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1cgwl7i._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1cnys8r._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1d4q9gf._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1e7vx35._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1he2uqp._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1hs29qq._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1hyz59c._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1id6lt6._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1ieaw8o._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1jehtjb._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1jnqgu8._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1k2tvfv._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0p1pt6i._.js → [root-of-the-server]__1kjpcz_._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1lulyuw._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1m1rllj._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1m91618._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0omg2wb._.js → [root-of-the-server]__1mki32r._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0-3ib_g._.js → [root-of-the-server]__1n_ks5s._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__1n6euz5._.js → [root-of-the-server]__1nj39zt._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1o2p5d4._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1o59f9e._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__05fsjsb._.js → [root-of-the-server]__1od6044._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1p32xvh._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1r19vvq._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1rtda2l._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1rup4sv._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1s5inmc._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__15za52u._.js → [root-of-the-server]__1sajsif._.js} +6 -6
- package/standalone/.next/server/chunks/[root-of-the-server]__1seny2-._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1soccc1._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1u_dbg2._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0hz1a1g._.js → [root-of-the-server]__1uinol4._.js} +6 -6
- package/standalone/.next/server/chunks/[root-of-the-server]__1ulp98y._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0chticn._.js → [root-of-the-server]__1utpbf1._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1wf1339._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1x2ubky._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1xehef8._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__1btz1fo._.js → [root-of-the-server]__1y343im._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__1x5laf2._.js → [root-of-the-server]__1yvqocu._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1yx0w43._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1yxkfi6._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1yye_uk._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__20du-cr._.js +3 -0
- package/standalone/.next/server/chunks/_01qtprx._.js +2 -2
- package/standalone/.next/server/chunks/_046r0fu._.js +1 -1
- package/standalone/.next/server/chunks/_0ap-sk4._.js +2 -2
- package/standalone/.next/server/chunks/_0km--pu._.js +1 -1
- package/standalone/.next/server/chunks/_19unz3y._.js +2 -2
- package/standalone/.next/server/chunks/_1e2b7v9._.js +1 -1
- package/standalone/.next/server/chunks/src_0o4-snj._.js +1 -1
- package/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +1 -1
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/package.json +3 -2
- package/standalone/server.js +1 -1
- package/standalone/.next/node_modules/re2-wasm-15fb420cc00a67dd/build/src/re2.js +0 -524
- package/standalone/.next/node_modules/re2-wasm-15fb420cc00a67dd/build/wasm/re2.js +0 -4570
- package/standalone/.next/node_modules/re2-wasm-15fb420cc00a67dd/build/wasm/re2.wasm +0 -0
- package/standalone/.next/node_modules/re2-wasm-15fb420cc00a67dd/package.json +0 -41
- package/standalone/.next/server/chunks/[root-of-the-server]__0_w-xej._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0_y2v1j._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0aars58._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0ah_4rn._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0axp9e2._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0cwh1ob._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0e6bqw-._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0emkieo._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0eqx3gx._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0ez1ocj._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0fpszsc._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0fq5bqy._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0fqft-4._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0g2wp1c._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0gvtj-n._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0i85me2._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0igsl3a._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0k60y67._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0niddrw._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0nrktjf._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0pgnk-c._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0rkz4xn._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0slps8j._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0tudmvl._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0u4_0hk._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0vaokmk._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0xomcdl._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0xrriyl._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0yhie6j._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__0yifxv-._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1-c37l2._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1-vnrg_._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__11r-5pu._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__12-cmv0._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__122sose._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__12_lxrq._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__12z-5e1._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1355z93._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__144k8e_._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__146ijbu._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__15dlw94._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__15epdi9._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__16a0le5._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__16paa96._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__17ry7s4._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__18m2a8z._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__18rxly1._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1_vhxix._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1_z6940._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1amwlm1._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1cncn_q._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1d8-kbp._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1fg8n77._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1fqhm93._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1h2n8mc._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1hy86s1._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1id0o8p._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1j1yxy_._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1kwbhuu._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1laf08m._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1myrk79._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1n3zakh._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1o7yplz._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1ohwk3-._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1onn1-5._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1pwcu28._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1q229ru._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1qtezlb._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1r6w6uj._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1rib6n3._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1sh_vn6._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1sx7rzl._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1taelgv._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1ts1wiq._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1uy4hea._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1uzbqwa._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1x6_y8g._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1xt0qaw._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1y1cne4._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1y6j2wu._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1y7j7qr._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1yj3ck2._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1ym73v7._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__218z_cj._.js +0 -3
- package/standalone/node_modules/re2-wasm/build/src/re2.js +0 -524
- package/standalone/node_modules/re2-wasm/build/wasm/re2.js +0 -4570
- package/standalone/node_modules/re2-wasm/build/wasm/re2.wasm +0 -0
- package/standalone/node_modules/re2-wasm/package.json +0 -41
- /package/standalone/.next/static/{9QiT0UQel9_P_z1ZucOq8 → VtuJ7hYfYlpY0_SOZN0oX}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{9QiT0UQel9_P_z1ZucOq8 → VtuJ7hYfYlpY0_SOZN0oX}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{9QiT0UQel9_P_z1ZucOq8 → VtuJ7hYfYlpY0_SOZN0oX}/_ssgManifest.js +0 -0
|
@@ -1,4570 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// The Module object: Our interface to the outside world. We import
|
|
4
|
-
// and export values on it. There are various ways Module can be used:
|
|
5
|
-
// 1. Not defined. We create it here
|
|
6
|
-
// 2. A function parameter, function(Module) { ..generated code.. }
|
|
7
|
-
// 3. pre-run appended it, var Module = {}; ..generated code..
|
|
8
|
-
// 4. External script tag defines var Module.
|
|
9
|
-
// We need to check if Module already exists (e.g. case 3 above).
|
|
10
|
-
// Substitution will be replaced with actual code on later stage of the build,
|
|
11
|
-
// this way Closure Compiler will not mangle it (e.g. case 4. above).
|
|
12
|
-
// Note that if you want to run closure, and also to use Module
|
|
13
|
-
// after the generated code, you will need to define var Module = {};
|
|
14
|
-
// before the code. Then that object will be used in the code, and you
|
|
15
|
-
// can continue to use Module afterwards as well.
|
|
16
|
-
var Module = typeof Module !== 'undefined' ? Module : {};
|
|
17
|
-
|
|
18
|
-
// --pre-jses are emitted after the Module integration code, so that they can
|
|
19
|
-
// refer to Module (if they choose; they can also define Module)
|
|
20
|
-
// {{PRE_JSES}}
|
|
21
|
-
|
|
22
|
-
// Sometimes an existing Module object exists with properties
|
|
23
|
-
// meant to overwrite the default module functionality. Here
|
|
24
|
-
// we collect those properties and reapply _after_ we configure
|
|
25
|
-
// the current environment's defaults to avoid having to be so
|
|
26
|
-
// defensive during initialization.
|
|
27
|
-
var moduleOverrides = {};
|
|
28
|
-
var key;
|
|
29
|
-
for (key in Module) {
|
|
30
|
-
if (Module.hasOwnProperty(key)) {
|
|
31
|
-
moduleOverrides[key] = Module[key];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var arguments_ = [];
|
|
36
|
-
var thisProgram = './this.program';
|
|
37
|
-
var quit_ = function(status, toThrow) {
|
|
38
|
-
throw toThrow;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Determine the runtime environment we are in. You can customize this by
|
|
42
|
-
// setting the ENVIRONMENT setting at compile time (see settings.js).
|
|
43
|
-
|
|
44
|
-
var ENVIRONMENT_IS_WEB = false;
|
|
45
|
-
var ENVIRONMENT_IS_WORKER = false;
|
|
46
|
-
var ENVIRONMENT_IS_NODE = false;
|
|
47
|
-
var ENVIRONMENT_IS_SHELL = false;
|
|
48
|
-
ENVIRONMENT_IS_WEB = typeof window === 'object';
|
|
49
|
-
ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
|
|
50
|
-
// N.b. Electron.js environment is simultaneously a NODE-environment, but
|
|
51
|
-
// also a web environment.
|
|
52
|
-
ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string';
|
|
53
|
-
ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
|
|
54
|
-
|
|
55
|
-
if (Module['ENVIRONMENT']) {
|
|
56
|
-
throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// `/` should be present at the end if `scriptDirectory` is not empty
|
|
60
|
-
var scriptDirectory = '';
|
|
61
|
-
function locateFile(path) {
|
|
62
|
-
if (Module['locateFile']) {
|
|
63
|
-
return Module['locateFile'](path, scriptDirectory);
|
|
64
|
-
}
|
|
65
|
-
return scriptDirectory + path;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Hooks that are implemented differently in different runtime environments.
|
|
69
|
-
var read_,
|
|
70
|
-
readAsync,
|
|
71
|
-
readBinary,
|
|
72
|
-
setWindowTitle;
|
|
73
|
-
|
|
74
|
-
var nodeFS;
|
|
75
|
-
var nodePath;
|
|
76
|
-
|
|
77
|
-
if (ENVIRONMENT_IS_NODE) {
|
|
78
|
-
if (ENVIRONMENT_IS_WORKER) {
|
|
79
|
-
scriptDirectory = require('path').dirname(scriptDirectory) + '/';
|
|
80
|
-
} else {
|
|
81
|
-
scriptDirectory = __dirname + '/';
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// include: node_shell_read.js
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
read_ = function shell_read(filename, binary) {
|
|
88
|
-
if (!nodeFS) nodeFS = require('fs');
|
|
89
|
-
if (!nodePath) nodePath = require('path');
|
|
90
|
-
filename = nodePath['normalize'](filename);
|
|
91
|
-
return nodeFS['readFileSync'](filename, binary ? null : 'utf8');
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
readBinary = function readBinary(filename) {
|
|
95
|
-
var ret = read_(filename, true);
|
|
96
|
-
if (!ret.buffer) {
|
|
97
|
-
ret = new Uint8Array(ret);
|
|
98
|
-
}
|
|
99
|
-
assert(ret.buffer);
|
|
100
|
-
return ret;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// end include: node_shell_read.js
|
|
104
|
-
if (process['argv'].length > 1) {
|
|
105
|
-
thisProgram = process['argv'][1].replace(/\\/g, '/');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
arguments_ = process['argv'].slice(2);
|
|
109
|
-
|
|
110
|
-
if (typeof module !== 'undefined') {
|
|
111
|
-
module['exports'] = Module;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
quit_ = function(status) {
|
|
115
|
-
process['exit'](status);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
Module['inspect'] = function () { return '[Emscripten Module object]'; };
|
|
119
|
-
|
|
120
|
-
} else
|
|
121
|
-
if (ENVIRONMENT_IS_SHELL) {
|
|
122
|
-
|
|
123
|
-
if (typeof read != 'undefined') {
|
|
124
|
-
read_ = function shell_read(f) {
|
|
125
|
-
return read(f);
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
readBinary = function readBinary(f) {
|
|
130
|
-
var data;
|
|
131
|
-
if (typeof readbuffer === 'function') {
|
|
132
|
-
return new Uint8Array(readbuffer(f));
|
|
133
|
-
}
|
|
134
|
-
data = read(f, 'binary');
|
|
135
|
-
assert(typeof data === 'object');
|
|
136
|
-
return data;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
if (typeof scriptArgs != 'undefined') {
|
|
140
|
-
arguments_ = scriptArgs;
|
|
141
|
-
} else if (typeof arguments != 'undefined') {
|
|
142
|
-
arguments_ = arguments;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (typeof quit === 'function') {
|
|
146
|
-
quit_ = function(status) {
|
|
147
|
-
quit(status);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (typeof print !== 'undefined') {
|
|
152
|
-
// Prefer to use print/printErr where they exist, as they usually work better.
|
|
153
|
-
if (typeof console === 'undefined') console = /** @type{!Console} */({});
|
|
154
|
-
console.log = /** @type{!function(this:Console, ...*): undefined} */ (print);
|
|
155
|
-
console.warn = console.error = /** @type{!function(this:Console, ...*): undefined} */ (typeof printErr !== 'undefined' ? printErr : print);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
} else
|
|
159
|
-
|
|
160
|
-
// Note that this includes Node.js workers when relevant (pthreads is enabled).
|
|
161
|
-
// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and
|
|
162
|
-
// ENVIRONMENT_IS_NODE.
|
|
163
|
-
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
|
164
|
-
if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled
|
|
165
|
-
scriptDirectory = self.location.href;
|
|
166
|
-
} else if (typeof document !== 'undefined' && document.currentScript) { // web
|
|
167
|
-
scriptDirectory = document.currentScript.src;
|
|
168
|
-
}
|
|
169
|
-
// blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them.
|
|
170
|
-
// otherwise, slice off the final part of the url to find the script directory.
|
|
171
|
-
// if scriptDirectory does not contain a slash, lastIndexOf will return -1,
|
|
172
|
-
// and scriptDirectory will correctly be replaced with an empty string.
|
|
173
|
-
if (scriptDirectory.indexOf('blob:') !== 0) {
|
|
174
|
-
scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf('/')+1);
|
|
175
|
-
} else {
|
|
176
|
-
scriptDirectory = '';
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Differentiate the Web Worker from the Node Worker case, as reading must
|
|
180
|
-
// be done differently.
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
// include: web_or_worker_shell_read.js
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
read_ = function shell_read(url) {
|
|
187
|
-
var xhr = new XMLHttpRequest();
|
|
188
|
-
xhr.open('GET', url, false);
|
|
189
|
-
xhr.send(null);
|
|
190
|
-
return xhr.responseText;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
if (ENVIRONMENT_IS_WORKER) {
|
|
194
|
-
readBinary = function readBinary(url) {
|
|
195
|
-
var xhr = new XMLHttpRequest();
|
|
196
|
-
xhr.open('GET', url, false);
|
|
197
|
-
xhr.responseType = 'arraybuffer';
|
|
198
|
-
xhr.send(null);
|
|
199
|
-
return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response));
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
readAsync = function readAsync(url, onload, onerror) {
|
|
204
|
-
var xhr = new XMLHttpRequest();
|
|
205
|
-
xhr.open('GET', url, true);
|
|
206
|
-
xhr.responseType = 'arraybuffer';
|
|
207
|
-
xhr.onload = function xhr_onload() {
|
|
208
|
-
if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
|
209
|
-
onload(xhr.response);
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
onerror();
|
|
213
|
-
};
|
|
214
|
-
xhr.onerror = onerror;
|
|
215
|
-
xhr.send(null);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
// end include: web_or_worker_shell_read.js
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
setWindowTitle = function(title) { document.title = title };
|
|
222
|
-
} else
|
|
223
|
-
{
|
|
224
|
-
throw new Error('environment detection error');
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Set up the out() and err() hooks, which are how we can print to stdout or
|
|
228
|
-
// stderr, respectively.
|
|
229
|
-
var out = Module['print'] || console.log.bind(console);
|
|
230
|
-
var err = Module['printErr'] || console.warn.bind(console);
|
|
231
|
-
|
|
232
|
-
// Merge back in the overrides
|
|
233
|
-
for (key in moduleOverrides) {
|
|
234
|
-
if (moduleOverrides.hasOwnProperty(key)) {
|
|
235
|
-
Module[key] = moduleOverrides[key];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
// Free the object hierarchy contained in the overrides, this lets the GC
|
|
239
|
-
// reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.
|
|
240
|
-
moduleOverrides = null;
|
|
241
|
-
|
|
242
|
-
// Emit code to handle expected values on the Module object. This applies Module.x
|
|
243
|
-
// to the proper local x. This has two benefits: first, we only emit it if it is
|
|
244
|
-
// expected to arrive, and second, by using a local everywhere else that can be
|
|
245
|
-
// minified.
|
|
246
|
-
if (Module['arguments']) arguments_ = Module['arguments'];if (!Object.getOwnPropertyDescriptor(Module, 'arguments')) Object.defineProperty(Module, 'arguments', { configurable: true, get: function() { abort('Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
247
|
-
if (Module['thisProgram']) thisProgram = Module['thisProgram'];if (!Object.getOwnPropertyDescriptor(Module, 'thisProgram')) Object.defineProperty(Module, 'thisProgram', { configurable: true, get: function() { abort('Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
248
|
-
if (Module['quit']) quit_ = Module['quit'];if (!Object.getOwnPropertyDescriptor(Module, 'quit')) Object.defineProperty(Module, 'quit', { configurable: true, get: function() { abort('Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
249
|
-
|
|
250
|
-
// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
|
|
251
|
-
// Assertions on removed incoming Module JS APIs.
|
|
252
|
-
assert(typeof Module['memoryInitializerPrefixURL'] === 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead');
|
|
253
|
-
assert(typeof Module['pthreadMainPrefixURL'] === 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead');
|
|
254
|
-
assert(typeof Module['cdInitializerPrefixURL'] === 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead');
|
|
255
|
-
assert(typeof Module['filePackagePrefixURL'] === 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead');
|
|
256
|
-
assert(typeof Module['read'] === 'undefined', 'Module.read option was removed (modify read_ in JS)');
|
|
257
|
-
assert(typeof Module['readAsync'] === 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)');
|
|
258
|
-
assert(typeof Module['readBinary'] === 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)');
|
|
259
|
-
assert(typeof Module['setWindowTitle'] === 'undefined', 'Module.setWindowTitle option was removed (modify setWindowTitle in JS)');
|
|
260
|
-
assert(typeof Module['TOTAL_MEMORY'] === 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');
|
|
261
|
-
if (!Object.getOwnPropertyDescriptor(Module, 'read')) Object.defineProperty(Module, 'read', { configurable: true, get: function() { abort('Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
262
|
-
if (!Object.getOwnPropertyDescriptor(Module, 'readAsync')) Object.defineProperty(Module, 'readAsync', { configurable: true, get: function() { abort('Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
263
|
-
if (!Object.getOwnPropertyDescriptor(Module, 'readBinary')) Object.defineProperty(Module, 'readBinary', { configurable: true, get: function() { abort('Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
264
|
-
if (!Object.getOwnPropertyDescriptor(Module, 'setWindowTitle')) Object.defineProperty(Module, 'setWindowTitle', { configurable: true, get: function() { abort('Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
265
|
-
var IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js';
|
|
266
|
-
var PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js';
|
|
267
|
-
var WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js';
|
|
268
|
-
var NODEFS = 'NODEFS is no longer included by default; build with -lnodefs.js';
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
var STACK_ALIGN = 16;
|
|
274
|
-
|
|
275
|
-
function alignMemory(size, factor) {
|
|
276
|
-
if (!factor) factor = STACK_ALIGN; // stack alignment (16-byte) by default
|
|
277
|
-
return Math.ceil(size / factor) * factor;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function getNativeTypeSize(type) {
|
|
281
|
-
switch (type) {
|
|
282
|
-
case 'i1': case 'i8': return 1;
|
|
283
|
-
case 'i16': return 2;
|
|
284
|
-
case 'i32': return 4;
|
|
285
|
-
case 'i64': return 8;
|
|
286
|
-
case 'float': return 4;
|
|
287
|
-
case 'double': return 8;
|
|
288
|
-
default: {
|
|
289
|
-
if (type[type.length-1] === '*') {
|
|
290
|
-
return 4; // A pointer
|
|
291
|
-
} else if (type[0] === 'i') {
|
|
292
|
-
var bits = Number(type.substr(1));
|
|
293
|
-
assert(bits % 8 === 0, 'getNativeTypeSize invalid bits ' + bits + ', type ' + type);
|
|
294
|
-
return bits / 8;
|
|
295
|
-
} else {
|
|
296
|
-
return 0;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function warnOnce(text) {
|
|
303
|
-
if (!warnOnce.shown) warnOnce.shown = {};
|
|
304
|
-
if (!warnOnce.shown[text]) {
|
|
305
|
-
warnOnce.shown[text] = 1;
|
|
306
|
-
err(text);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// include: runtime_functions.js
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
// Wraps a JS function as a wasm function with a given signature.
|
|
314
|
-
function convertJsFunctionToWasm(func, sig) {
|
|
315
|
-
|
|
316
|
-
// If the type reflection proposal is available, use the new
|
|
317
|
-
// "WebAssembly.Function" constructor.
|
|
318
|
-
// Otherwise, construct a minimal wasm module importing the JS function and
|
|
319
|
-
// re-exporting it.
|
|
320
|
-
if (typeof WebAssembly.Function === "function") {
|
|
321
|
-
var typeNames = {
|
|
322
|
-
'i': 'i32',
|
|
323
|
-
'j': 'i64',
|
|
324
|
-
'f': 'f32',
|
|
325
|
-
'd': 'f64'
|
|
326
|
-
};
|
|
327
|
-
var type = {
|
|
328
|
-
parameters: [],
|
|
329
|
-
results: sig[0] == 'v' ? [] : [typeNames[sig[0]]]
|
|
330
|
-
};
|
|
331
|
-
for (var i = 1; i < sig.length; ++i) {
|
|
332
|
-
type.parameters.push(typeNames[sig[i]]);
|
|
333
|
-
}
|
|
334
|
-
return new WebAssembly.Function(type, func);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// The module is static, with the exception of the type section, which is
|
|
338
|
-
// generated based on the signature passed in.
|
|
339
|
-
var typeSection = [
|
|
340
|
-
0x01, // id: section,
|
|
341
|
-
0x00, // length: 0 (placeholder)
|
|
342
|
-
0x01, // count: 1
|
|
343
|
-
0x60, // form: func
|
|
344
|
-
];
|
|
345
|
-
var sigRet = sig.slice(0, 1);
|
|
346
|
-
var sigParam = sig.slice(1);
|
|
347
|
-
var typeCodes = {
|
|
348
|
-
'i': 0x7f, // i32
|
|
349
|
-
'j': 0x7e, // i64
|
|
350
|
-
'f': 0x7d, // f32
|
|
351
|
-
'd': 0x7c, // f64
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
// Parameters, length + signatures
|
|
355
|
-
typeSection.push(sigParam.length);
|
|
356
|
-
for (var i = 0; i < sigParam.length; ++i) {
|
|
357
|
-
typeSection.push(typeCodes[sigParam[i]]);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// Return values, length + signatures
|
|
361
|
-
// With no multi-return in MVP, either 0 (void) or 1 (anything else)
|
|
362
|
-
if (sigRet == 'v') {
|
|
363
|
-
typeSection.push(0x00);
|
|
364
|
-
} else {
|
|
365
|
-
typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// Write the overall length of the type section back into the section header
|
|
369
|
-
// (excepting the 2 bytes for the section id and length)
|
|
370
|
-
typeSection[1] = typeSection.length - 2;
|
|
371
|
-
|
|
372
|
-
// Rest of the module is static
|
|
373
|
-
var bytes = new Uint8Array([
|
|
374
|
-
0x00, 0x61, 0x73, 0x6d, // magic ("\0asm")
|
|
375
|
-
0x01, 0x00, 0x00, 0x00, // version: 1
|
|
376
|
-
].concat(typeSection, [
|
|
377
|
-
0x02, 0x07, // import section
|
|
378
|
-
// (import "e" "f" (func 0 (type 0)))
|
|
379
|
-
0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,
|
|
380
|
-
0x07, 0x05, // export section
|
|
381
|
-
// (export "f" (func 0 (type 0)))
|
|
382
|
-
0x01, 0x01, 0x66, 0x00, 0x00,
|
|
383
|
-
]));
|
|
384
|
-
|
|
385
|
-
// We can compile this wasm module synchronously because it is very small.
|
|
386
|
-
// This accepts an import (at "e.f"), that it reroutes to an export (at "f")
|
|
387
|
-
var module = new WebAssembly.Module(bytes);
|
|
388
|
-
var instance = new WebAssembly.Instance(module, {
|
|
389
|
-
'e': {
|
|
390
|
-
'f': func
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
var wrappedFunc = instance.exports['f'];
|
|
394
|
-
return wrappedFunc;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
var freeTableIndexes = [];
|
|
398
|
-
|
|
399
|
-
// Weak map of functions in the table to their indexes, created on first use.
|
|
400
|
-
var functionsInTableMap;
|
|
401
|
-
|
|
402
|
-
function getEmptyTableSlot() {
|
|
403
|
-
// Reuse a free index if there is one, otherwise grow.
|
|
404
|
-
if (freeTableIndexes.length) {
|
|
405
|
-
return freeTableIndexes.pop();
|
|
406
|
-
}
|
|
407
|
-
// Grow the table
|
|
408
|
-
try {
|
|
409
|
-
wasmTable.grow(1);
|
|
410
|
-
} catch (err) {
|
|
411
|
-
if (!(err instanceof RangeError)) {
|
|
412
|
-
throw err;
|
|
413
|
-
}
|
|
414
|
-
throw 'Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.';
|
|
415
|
-
}
|
|
416
|
-
return wasmTable.length - 1;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// Add a wasm function to the table.
|
|
420
|
-
function addFunctionWasm(func, sig) {
|
|
421
|
-
// Check if the function is already in the table, to ensure each function
|
|
422
|
-
// gets a unique index. First, create the map if this is the first use.
|
|
423
|
-
if (!functionsInTableMap) {
|
|
424
|
-
functionsInTableMap = new WeakMap();
|
|
425
|
-
for (var i = 0; i < wasmTable.length; i++) {
|
|
426
|
-
var item = wasmTable.get(i);
|
|
427
|
-
// Ignore null values.
|
|
428
|
-
if (item) {
|
|
429
|
-
functionsInTableMap.set(item, i);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
if (functionsInTableMap.has(func)) {
|
|
434
|
-
return functionsInTableMap.get(func);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// It's not in the table, add it now.
|
|
438
|
-
|
|
439
|
-
var ret = getEmptyTableSlot();
|
|
440
|
-
|
|
441
|
-
// Set the new value.
|
|
442
|
-
try {
|
|
443
|
-
// Attempting to call this with JS function will cause of table.set() to fail
|
|
444
|
-
wasmTable.set(ret, func);
|
|
445
|
-
} catch (err) {
|
|
446
|
-
if (!(err instanceof TypeError)) {
|
|
447
|
-
throw err;
|
|
448
|
-
}
|
|
449
|
-
assert(typeof sig !== 'undefined', 'Missing signature argument to addFunction: ' + func);
|
|
450
|
-
var wrapped = convertJsFunctionToWasm(func, sig);
|
|
451
|
-
wasmTable.set(ret, wrapped);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
functionsInTableMap.set(func, ret);
|
|
455
|
-
|
|
456
|
-
return ret;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
function removeFunction(index) {
|
|
460
|
-
functionsInTableMap.delete(wasmTable.get(index));
|
|
461
|
-
freeTableIndexes.push(index);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// 'sig' parameter is required for the llvm backend but only when func is not
|
|
465
|
-
// already a WebAssembly function.
|
|
466
|
-
function addFunction(func, sig) {
|
|
467
|
-
assert(typeof func !== 'undefined');
|
|
468
|
-
|
|
469
|
-
return addFunctionWasm(func, sig);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// end include: runtime_functions.js
|
|
473
|
-
// include: runtime_debug.js
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
// end include: runtime_debug.js
|
|
477
|
-
function makeBigInt(low, high, unsigned) {
|
|
478
|
-
return unsigned ? ((+((low>>>0)))+((+((high>>>0)))*4294967296.0)) : ((+((low>>>0)))+((+((high|0)))*4294967296.0));
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
var tempRet0 = 0;
|
|
482
|
-
|
|
483
|
-
var setTempRet0 = function(value) {
|
|
484
|
-
tempRet0 = value;
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
var getTempRet0 = function() {
|
|
488
|
-
return tempRet0;
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
function getCompilerSetting(name) {
|
|
492
|
-
throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for getCompilerSetting or emscripten_get_compiler_setting to work';
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
// === Preamble library stuff ===
|
|
498
|
-
|
|
499
|
-
// Documentation for the public APIs defined in this file must be updated in:
|
|
500
|
-
// site/source/docs/api_reference/preamble.js.rst
|
|
501
|
-
// A prebuilt local version of the documentation is available at:
|
|
502
|
-
// site/build/text/docs/api_reference/preamble.js.txt
|
|
503
|
-
// You can also build docs locally as HTML or other formats in site/
|
|
504
|
-
// An online HTML version (which may be of a different version of Emscripten)
|
|
505
|
-
// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
|
|
506
|
-
|
|
507
|
-
var wasmBinary;if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];if (!Object.getOwnPropertyDescriptor(Module, 'wasmBinary')) Object.defineProperty(Module, 'wasmBinary', { configurable: true, get: function() { abort('Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
508
|
-
var noExitRuntime;if (Module['noExitRuntime']) noExitRuntime = Module['noExitRuntime'];if (!Object.getOwnPropertyDescriptor(Module, 'noExitRuntime')) Object.defineProperty(Module, 'noExitRuntime', { configurable: true, get: function() { abort('Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
509
|
-
|
|
510
|
-
if (typeof WebAssembly !== 'object') {
|
|
511
|
-
abort('no native wasm support detected');
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
// include: runtime_safe_heap.js
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
// In MINIMAL_RUNTIME, setValue() and getValue() are only available when building with safe heap enabled, for heap safety checking.
|
|
518
|
-
// In traditional runtime, setValue() and getValue() are always available (although their use is highly discouraged due to perf penalties)
|
|
519
|
-
|
|
520
|
-
/** @param {number} ptr
|
|
521
|
-
@param {number} value
|
|
522
|
-
@param {string} type
|
|
523
|
-
@param {number|boolean=} noSafe */
|
|
524
|
-
function setValue(ptr, value, type, noSafe) {
|
|
525
|
-
type = type || 'i8';
|
|
526
|
-
if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
|
|
527
|
-
switch(type) {
|
|
528
|
-
case 'i1': HEAP8[((ptr)>>0)]=value; break;
|
|
529
|
-
case 'i8': HEAP8[((ptr)>>0)]=value; break;
|
|
530
|
-
case 'i16': HEAP16[((ptr)>>1)]=value; break;
|
|
531
|
-
case 'i32': HEAP32[((ptr)>>2)]=value; break;
|
|
532
|
-
case 'i64': (tempI64 = [value>>>0,(tempDouble=value,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math.min((+(Math.floor((tempDouble)/4294967296.0))), 4294967295.0))|0)>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
|
|
533
|
-
case 'float': HEAPF32[((ptr)>>2)]=value; break;
|
|
534
|
-
case 'double': HEAPF64[((ptr)>>3)]=value; break;
|
|
535
|
-
default: abort('invalid type for setValue: ' + type);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/** @param {number} ptr
|
|
540
|
-
@param {string} type
|
|
541
|
-
@param {number|boolean=} noSafe */
|
|
542
|
-
function getValue(ptr, type, noSafe) {
|
|
543
|
-
type = type || 'i8';
|
|
544
|
-
if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
|
|
545
|
-
switch(type) {
|
|
546
|
-
case 'i1': return HEAP8[((ptr)>>0)];
|
|
547
|
-
case 'i8': return HEAP8[((ptr)>>0)];
|
|
548
|
-
case 'i16': return HEAP16[((ptr)>>1)];
|
|
549
|
-
case 'i32': return HEAP32[((ptr)>>2)];
|
|
550
|
-
case 'i64': return HEAP32[((ptr)>>2)];
|
|
551
|
-
case 'float': return HEAPF32[((ptr)>>2)];
|
|
552
|
-
case 'double': return HEAPF64[((ptr)>>3)];
|
|
553
|
-
default: abort('invalid type for getValue: ' + type);
|
|
554
|
-
}
|
|
555
|
-
return null;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
// end include: runtime_safe_heap.js
|
|
559
|
-
// Wasm globals
|
|
560
|
-
|
|
561
|
-
var wasmMemory;
|
|
562
|
-
|
|
563
|
-
//========================================
|
|
564
|
-
// Runtime essentials
|
|
565
|
-
//========================================
|
|
566
|
-
|
|
567
|
-
// whether we are quitting the application. no code should run after this.
|
|
568
|
-
// set in exit() and abort()
|
|
569
|
-
var ABORT = false;
|
|
570
|
-
|
|
571
|
-
// set by exit() and abort(). Passed to 'onExit' handler.
|
|
572
|
-
// NOTE: This is also used as the process return code code in shell environments
|
|
573
|
-
// but only when noExitRuntime is false.
|
|
574
|
-
var EXITSTATUS = 0;
|
|
575
|
-
|
|
576
|
-
/** @type {function(*, string=)} */
|
|
577
|
-
function assert(condition, text) {
|
|
578
|
-
if (!condition) {
|
|
579
|
-
abort('Assertion failed: ' + text);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
|
|
584
|
-
function getCFunc(ident) {
|
|
585
|
-
var func = Module['_' + ident]; // closure exported function
|
|
586
|
-
assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported');
|
|
587
|
-
return func;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// C calling interface.
|
|
591
|
-
/** @param {string|null=} returnType
|
|
592
|
-
@param {Array=} argTypes
|
|
593
|
-
@param {Arguments|Array=} args
|
|
594
|
-
@param {Object=} opts */
|
|
595
|
-
function ccall(ident, returnType, argTypes, args, opts) {
|
|
596
|
-
// For fast lookup of conversion functions
|
|
597
|
-
var toC = {
|
|
598
|
-
'string': function(str) {
|
|
599
|
-
var ret = 0;
|
|
600
|
-
if (str !== null && str !== undefined && str !== 0) { // null string
|
|
601
|
-
// at most 4 bytes per UTF-8 code point, +1 for the trailing '\0'
|
|
602
|
-
var len = (str.length << 2) + 1;
|
|
603
|
-
ret = stackAlloc(len);
|
|
604
|
-
stringToUTF8(str, ret, len);
|
|
605
|
-
}
|
|
606
|
-
return ret;
|
|
607
|
-
},
|
|
608
|
-
'array': function(arr) {
|
|
609
|
-
var ret = stackAlloc(arr.length);
|
|
610
|
-
writeArrayToMemory(arr, ret);
|
|
611
|
-
return ret;
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
function convertReturnValue(ret) {
|
|
616
|
-
if (returnType === 'string') return UTF8ToString(ret);
|
|
617
|
-
if (returnType === 'boolean') return Boolean(ret);
|
|
618
|
-
return ret;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
var func = getCFunc(ident);
|
|
622
|
-
var cArgs = [];
|
|
623
|
-
var stack = 0;
|
|
624
|
-
assert(returnType !== 'array', 'Return type should not be "array".');
|
|
625
|
-
if (args) {
|
|
626
|
-
for (var i = 0; i < args.length; i++) {
|
|
627
|
-
var converter = toC[argTypes[i]];
|
|
628
|
-
if (converter) {
|
|
629
|
-
if (stack === 0) stack = stackSave();
|
|
630
|
-
cArgs[i] = converter(args[i]);
|
|
631
|
-
} else {
|
|
632
|
-
cArgs[i] = args[i];
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
var ret = func.apply(null, cArgs);
|
|
637
|
-
|
|
638
|
-
ret = convertReturnValue(ret);
|
|
639
|
-
if (stack !== 0) stackRestore(stack);
|
|
640
|
-
return ret;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
/** @param {string=} returnType
|
|
644
|
-
@param {Array=} argTypes
|
|
645
|
-
@param {Object=} opts */
|
|
646
|
-
function cwrap(ident, returnType, argTypes, opts) {
|
|
647
|
-
return function() {
|
|
648
|
-
return ccall(ident, returnType, argTypes, arguments, opts);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
// We used to include malloc/free by default in the past. Show a helpful error in
|
|
653
|
-
// builds with assertions.
|
|
654
|
-
|
|
655
|
-
var ALLOC_NORMAL = 0; // Tries to use _malloc()
|
|
656
|
-
var ALLOC_STACK = 1; // Lives for the duration of the current function call
|
|
657
|
-
|
|
658
|
-
// allocate(): This is for internal use. You can use it yourself as well, but the interface
|
|
659
|
-
// is a little tricky (see docs right below). The reason is that it is optimized
|
|
660
|
-
// for multiple syntaxes to save space in generated code. So you should
|
|
661
|
-
// normally not use allocate(), and instead allocate memory using _malloc(),
|
|
662
|
-
// initialize it with setValue(), and so forth.
|
|
663
|
-
// @slab: An array of data.
|
|
664
|
-
// @allocator: How to allocate memory, see ALLOC_*
|
|
665
|
-
/** @type {function((Uint8Array|Array<number>), number)} */
|
|
666
|
-
function allocate(slab, allocator) {
|
|
667
|
-
var ret;
|
|
668
|
-
assert(typeof allocator === 'number', 'allocate no longer takes a type argument')
|
|
669
|
-
assert(typeof slab !== 'number', 'allocate no longer takes a number as arg0')
|
|
670
|
-
|
|
671
|
-
if (allocator == ALLOC_STACK) {
|
|
672
|
-
ret = stackAlloc(slab.length);
|
|
673
|
-
} else {
|
|
674
|
-
ret = _malloc(slab.length);
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
if (slab.subarray || slab.slice) {
|
|
678
|
-
HEAPU8.set(/** @type {!Uint8Array} */(slab), ret);
|
|
679
|
-
} else {
|
|
680
|
-
HEAPU8.set(new Uint8Array(slab), ret);
|
|
681
|
-
}
|
|
682
|
-
return ret;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
// include: runtime_strings.js
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
// runtime_strings.js: Strings related runtime functions that are part of both MINIMAL_RUNTIME and regular runtime.
|
|
689
|
-
|
|
690
|
-
// Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns
|
|
691
|
-
// a copy of that string as a Javascript String object.
|
|
692
|
-
|
|
693
|
-
var UTF8Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined;
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* @param {number} idx
|
|
697
|
-
* @param {number=} maxBytesToRead
|
|
698
|
-
* @return {string}
|
|
699
|
-
*/
|
|
700
|
-
function UTF8ArrayToString(heap, idx, maxBytesToRead) {
|
|
701
|
-
var endIdx = idx + maxBytesToRead;
|
|
702
|
-
var endPtr = idx;
|
|
703
|
-
// TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
|
|
704
|
-
// Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
|
|
705
|
-
// (As a tiny code save trick, compare endPtr against endIdx using a negation, so that undefined means Infinity)
|
|
706
|
-
while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
|
707
|
-
|
|
708
|
-
if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
|
|
709
|
-
return UTF8Decoder.decode(heap.subarray(idx, endPtr));
|
|
710
|
-
} else {
|
|
711
|
-
var str = '';
|
|
712
|
-
// If building with TextDecoder, we have already computed the string length above, so test loop end condition against that
|
|
713
|
-
while (idx < endPtr) {
|
|
714
|
-
// For UTF8 byte structure, see:
|
|
715
|
-
// http://en.wikipedia.org/wiki/UTF-8#Description
|
|
716
|
-
// https://www.ietf.org/rfc/rfc2279.txt
|
|
717
|
-
// https://tools.ietf.org/html/rfc3629
|
|
718
|
-
var u0 = heap[idx++];
|
|
719
|
-
if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }
|
|
720
|
-
var u1 = heap[idx++] & 63;
|
|
721
|
-
if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }
|
|
722
|
-
var u2 = heap[idx++] & 63;
|
|
723
|
-
if ((u0 & 0xF0) == 0xE0) {
|
|
724
|
-
u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
|
|
725
|
-
} else {
|
|
726
|
-
if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte 0x' + u0.toString(16) + ' encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!');
|
|
727
|
-
u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63);
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
if (u0 < 0x10000) {
|
|
731
|
-
str += String.fromCharCode(u0);
|
|
732
|
-
} else {
|
|
733
|
-
var ch = u0 - 0x10000;
|
|
734
|
-
str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
return str;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
// Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns a
|
|
742
|
-
// copy of that string as a Javascript String object.
|
|
743
|
-
// maxBytesToRead: an optional length that specifies the maximum number of bytes to read. You can omit
|
|
744
|
-
// this parameter to scan the string until the first \0 byte. If maxBytesToRead is
|
|
745
|
-
// passed, and the string at [ptr, ptr+maxBytesToReadr[ contains a null byte in the
|
|
746
|
-
// middle, then the string will cut short at that byte index (i.e. maxBytesToRead will
|
|
747
|
-
// not produce a string of exact length [ptr, ptr+maxBytesToRead[)
|
|
748
|
-
// N.B. mixing frequent uses of UTF8ToString() with and without maxBytesToRead may
|
|
749
|
-
// throw JS JIT optimizations off, so it is worth to consider consistently using one
|
|
750
|
-
// style or the other.
|
|
751
|
-
/**
|
|
752
|
-
* @param {number} ptr
|
|
753
|
-
* @param {number=} maxBytesToRead
|
|
754
|
-
* @return {string}
|
|
755
|
-
*/
|
|
756
|
-
function UTF8ToString(ptr, maxBytesToRead) {
|
|
757
|
-
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
// Copies the given Javascript String object 'str' to the given byte array at address 'outIdx',
|
|
761
|
-
// encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP.
|
|
762
|
-
// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
|
|
763
|
-
// Parameters:
|
|
764
|
-
// str: the Javascript string to copy.
|
|
765
|
-
// heap: the array to copy to. Each index in this array is assumed to be one 8-byte element.
|
|
766
|
-
// outIdx: The starting offset in the array to begin the copying.
|
|
767
|
-
// maxBytesToWrite: The maximum number of bytes this function can write to the array.
|
|
768
|
-
// This count should include the null terminator,
|
|
769
|
-
// i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else.
|
|
770
|
-
// maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator.
|
|
771
|
-
// Returns the number of bytes written, EXCLUDING the null terminator.
|
|
772
|
-
|
|
773
|
-
function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
|
|
774
|
-
if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.
|
|
775
|
-
return 0;
|
|
776
|
-
|
|
777
|
-
var startIdx = outIdx;
|
|
778
|
-
var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
|
|
779
|
-
for (var i = 0; i < str.length; ++i) {
|
|
780
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
|
|
781
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
782
|
-
// For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629
|
|
783
|
-
var u = str.charCodeAt(i); // possibly a lead surrogate
|
|
784
|
-
if (u >= 0xD800 && u <= 0xDFFF) {
|
|
785
|
-
var u1 = str.charCodeAt(++i);
|
|
786
|
-
u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF);
|
|
787
|
-
}
|
|
788
|
-
if (u <= 0x7F) {
|
|
789
|
-
if (outIdx >= endIdx) break;
|
|
790
|
-
heap[outIdx++] = u;
|
|
791
|
-
} else if (u <= 0x7FF) {
|
|
792
|
-
if (outIdx + 1 >= endIdx) break;
|
|
793
|
-
heap[outIdx++] = 0xC0 | (u >> 6);
|
|
794
|
-
heap[outIdx++] = 0x80 | (u & 63);
|
|
795
|
-
} else if (u <= 0xFFFF) {
|
|
796
|
-
if (outIdx + 2 >= endIdx) break;
|
|
797
|
-
heap[outIdx++] = 0xE0 | (u >> 12);
|
|
798
|
-
heap[outIdx++] = 0x80 | ((u >> 6) & 63);
|
|
799
|
-
heap[outIdx++] = 0x80 | (u & 63);
|
|
800
|
-
} else {
|
|
801
|
-
if (outIdx + 3 >= endIdx) break;
|
|
802
|
-
if (u >= 0x200000) warnOnce('Invalid Unicode code point 0x' + u.toString(16) + ' encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).');
|
|
803
|
-
heap[outIdx++] = 0xF0 | (u >> 18);
|
|
804
|
-
heap[outIdx++] = 0x80 | ((u >> 12) & 63);
|
|
805
|
-
heap[outIdx++] = 0x80 | ((u >> 6) & 63);
|
|
806
|
-
heap[outIdx++] = 0x80 | (u & 63);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
// Null-terminate the pointer to the buffer.
|
|
810
|
-
heap[outIdx] = 0;
|
|
811
|
-
return outIdx - startIdx;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
|
|
815
|
-
// null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP.
|
|
816
|
-
// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write.
|
|
817
|
-
// Returns the number of bytes written, EXCLUDING the null terminator.
|
|
818
|
-
|
|
819
|
-
function stringToUTF8(str, outPtr, maxBytesToWrite) {
|
|
820
|
-
assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
|
|
821
|
-
return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
|
|
825
|
-
function lengthBytesUTF8(str) {
|
|
826
|
-
var len = 0;
|
|
827
|
-
for (var i = 0; i < str.length; ++i) {
|
|
828
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8.
|
|
829
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
830
|
-
var u = str.charCodeAt(i); // possibly a lead surrogate
|
|
831
|
-
if (u >= 0xD800 && u <= 0xDFFF) u = 0x10000 + ((u & 0x3FF) << 10) | (str.charCodeAt(++i) & 0x3FF);
|
|
832
|
-
if (u <= 0x7F) ++len;
|
|
833
|
-
else if (u <= 0x7FF) len += 2;
|
|
834
|
-
else if (u <= 0xFFFF) len += 3;
|
|
835
|
-
else len += 4;
|
|
836
|
-
}
|
|
837
|
-
return len;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
// end include: runtime_strings.js
|
|
841
|
-
// include: runtime_strings_extra.js
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
// runtime_strings_extra.js: Strings related runtime functions that are available only in regular runtime.
|
|
845
|
-
|
|
846
|
-
// Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns
|
|
847
|
-
// a copy of that string as a Javascript String object.
|
|
848
|
-
|
|
849
|
-
function AsciiToString(ptr) {
|
|
850
|
-
var str = '';
|
|
851
|
-
while (1) {
|
|
852
|
-
var ch = HEAPU8[((ptr++)>>0)];
|
|
853
|
-
if (!ch) return str;
|
|
854
|
-
str += String.fromCharCode(ch);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
|
|
859
|
-
// null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP.
|
|
860
|
-
|
|
861
|
-
function stringToAscii(str, outPtr) {
|
|
862
|
-
return writeAsciiToMemory(str, outPtr, false);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns
|
|
866
|
-
// a copy of that string as a Javascript String object.
|
|
867
|
-
|
|
868
|
-
var UTF16Decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-16le') : undefined;
|
|
869
|
-
|
|
870
|
-
function UTF16ToString(ptr, maxBytesToRead) {
|
|
871
|
-
assert(ptr % 2 == 0, 'Pointer passed to UTF16ToString must be aligned to two bytes!');
|
|
872
|
-
var endPtr = ptr;
|
|
873
|
-
// TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself.
|
|
874
|
-
// Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage.
|
|
875
|
-
var idx = endPtr >> 1;
|
|
876
|
-
var maxIdx = idx + maxBytesToRead / 2;
|
|
877
|
-
// If maxBytesToRead is not passed explicitly, it will be undefined, and this
|
|
878
|
-
// will always evaluate to true. This saves on code size.
|
|
879
|
-
while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx;
|
|
880
|
-
endPtr = idx << 1;
|
|
881
|
-
|
|
882
|
-
if (endPtr - ptr > 32 && UTF16Decoder) {
|
|
883
|
-
return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr));
|
|
884
|
-
} else {
|
|
885
|
-
var str = '';
|
|
886
|
-
|
|
887
|
-
// If maxBytesToRead is not passed explicitly, it will be undefined, and the for-loop's condition
|
|
888
|
-
// will always evaluate to true. The loop is then terminated on the first null char.
|
|
889
|
-
for (var i = 0; !(i >= maxBytesToRead / 2); ++i) {
|
|
890
|
-
var codeUnit = HEAP16[(((ptr)+(i*2))>>1)];
|
|
891
|
-
if (codeUnit == 0) break;
|
|
892
|
-
// fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through.
|
|
893
|
-
str += String.fromCharCode(codeUnit);
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
return str;
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
|
|
901
|
-
// null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP.
|
|
902
|
-
// Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write.
|
|
903
|
-
// Parameters:
|
|
904
|
-
// str: the Javascript string to copy.
|
|
905
|
-
// outPtr: Byte address in Emscripten HEAP where to write the string to.
|
|
906
|
-
// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
|
|
907
|
-
// terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else.
|
|
908
|
-
// maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator.
|
|
909
|
-
// Returns the number of bytes written, EXCLUDING the null terminator.
|
|
910
|
-
|
|
911
|
-
function stringToUTF16(str, outPtr, maxBytesToWrite) {
|
|
912
|
-
assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!');
|
|
913
|
-
assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
|
|
914
|
-
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
|
|
915
|
-
if (maxBytesToWrite === undefined) {
|
|
916
|
-
maxBytesToWrite = 0x7FFFFFFF;
|
|
917
|
-
}
|
|
918
|
-
if (maxBytesToWrite < 2) return 0;
|
|
919
|
-
maxBytesToWrite -= 2; // Null terminator.
|
|
920
|
-
var startPtr = outPtr;
|
|
921
|
-
var numCharsToWrite = (maxBytesToWrite < str.length*2) ? (maxBytesToWrite / 2) : str.length;
|
|
922
|
-
for (var i = 0; i < numCharsToWrite; ++i) {
|
|
923
|
-
// charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
|
|
924
|
-
var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
|
|
925
|
-
HEAP16[((outPtr)>>1)]=codeUnit;
|
|
926
|
-
outPtr += 2;
|
|
927
|
-
}
|
|
928
|
-
// Null-terminate the pointer to the HEAP.
|
|
929
|
-
HEAP16[((outPtr)>>1)]=0;
|
|
930
|
-
return outPtr - startPtr;
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
|
|
934
|
-
|
|
935
|
-
function lengthBytesUTF16(str) {
|
|
936
|
-
return str.length*2;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
function UTF32ToString(ptr, maxBytesToRead) {
|
|
940
|
-
assert(ptr % 4 == 0, 'Pointer passed to UTF32ToString must be aligned to four bytes!');
|
|
941
|
-
var i = 0;
|
|
942
|
-
|
|
943
|
-
var str = '';
|
|
944
|
-
// If maxBytesToRead is not passed explicitly, it will be undefined, and this
|
|
945
|
-
// will always evaluate to true. This saves on code size.
|
|
946
|
-
while (!(i >= maxBytesToRead / 4)) {
|
|
947
|
-
var utf32 = HEAP32[(((ptr)+(i*4))>>2)];
|
|
948
|
-
if (utf32 == 0) break;
|
|
949
|
-
++i;
|
|
950
|
-
// Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing.
|
|
951
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
952
|
-
if (utf32 >= 0x10000) {
|
|
953
|
-
var ch = utf32 - 0x10000;
|
|
954
|
-
str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
|
|
955
|
-
} else {
|
|
956
|
-
str += String.fromCharCode(utf32);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
return str;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr',
|
|
963
|
-
// null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP.
|
|
964
|
-
// Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write.
|
|
965
|
-
// Parameters:
|
|
966
|
-
// str: the Javascript string to copy.
|
|
967
|
-
// outPtr: Byte address in Emscripten HEAP where to write the string to.
|
|
968
|
-
// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null
|
|
969
|
-
// terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else.
|
|
970
|
-
// maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator.
|
|
971
|
-
// Returns the number of bytes written, EXCLUDING the null terminator.
|
|
972
|
-
|
|
973
|
-
function stringToUTF32(str, outPtr, maxBytesToWrite) {
|
|
974
|
-
assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!');
|
|
975
|
-
assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');
|
|
976
|
-
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
|
|
977
|
-
if (maxBytesToWrite === undefined) {
|
|
978
|
-
maxBytesToWrite = 0x7FFFFFFF;
|
|
979
|
-
}
|
|
980
|
-
if (maxBytesToWrite < 4) return 0;
|
|
981
|
-
var startPtr = outPtr;
|
|
982
|
-
var endPtr = startPtr + maxBytesToWrite - 4;
|
|
983
|
-
for (var i = 0; i < str.length; ++i) {
|
|
984
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
|
|
985
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
986
|
-
var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
|
|
987
|
-
if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) {
|
|
988
|
-
var trailSurrogate = str.charCodeAt(++i);
|
|
989
|
-
codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | (trailSurrogate & 0x3FF);
|
|
990
|
-
}
|
|
991
|
-
HEAP32[((outPtr)>>2)]=codeUnit;
|
|
992
|
-
outPtr += 4;
|
|
993
|
-
if (outPtr + 4 > endPtr) break;
|
|
994
|
-
}
|
|
995
|
-
// Null-terminate the pointer to the HEAP.
|
|
996
|
-
HEAP32[((outPtr)>>2)]=0;
|
|
997
|
-
return outPtr - startPtr;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
|
|
1001
|
-
|
|
1002
|
-
function lengthBytesUTF32(str) {
|
|
1003
|
-
var len = 0;
|
|
1004
|
-
for (var i = 0; i < str.length; ++i) {
|
|
1005
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
|
|
1006
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
1007
|
-
var codeUnit = str.charCodeAt(i);
|
|
1008
|
-
if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate.
|
|
1009
|
-
len += 4;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
return len;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
// Allocate heap space for a JS string, and write it there.
|
|
1016
|
-
// It is the responsibility of the caller to free() that memory.
|
|
1017
|
-
function allocateUTF8(str) {
|
|
1018
|
-
var size = lengthBytesUTF8(str) + 1;
|
|
1019
|
-
var ret = _malloc(size);
|
|
1020
|
-
if (ret) stringToUTF8Array(str, HEAP8, ret, size);
|
|
1021
|
-
return ret;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
// Allocate stack space for a JS string, and write it there.
|
|
1025
|
-
function allocateUTF8OnStack(str) {
|
|
1026
|
-
var size = lengthBytesUTF8(str) + 1;
|
|
1027
|
-
var ret = stackAlloc(size);
|
|
1028
|
-
stringToUTF8Array(str, HEAP8, ret, size);
|
|
1029
|
-
return ret;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
// Deprecated: This function should not be called because it is unsafe and does not provide
|
|
1033
|
-
// a maximum length limit of how many bytes it is allowed to write. Prefer calling the
|
|
1034
|
-
// function stringToUTF8Array() instead, which takes in a maximum length that can be used
|
|
1035
|
-
// to be secure from out of bounds writes.
|
|
1036
|
-
/** @deprecated
|
|
1037
|
-
@param {boolean=} dontAddNull */
|
|
1038
|
-
function writeStringToMemory(string, buffer, dontAddNull) {
|
|
1039
|
-
warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!');
|
|
1040
|
-
|
|
1041
|
-
var /** @type {number} */ lastChar, /** @type {number} */ end;
|
|
1042
|
-
if (dontAddNull) {
|
|
1043
|
-
// stringToUTF8Array always appends null. If we don't want to do that, remember the
|
|
1044
|
-
// character that existed at the location where the null will be placed, and restore
|
|
1045
|
-
// that after the write (below).
|
|
1046
|
-
end = buffer + lengthBytesUTF8(string);
|
|
1047
|
-
lastChar = HEAP8[end];
|
|
1048
|
-
}
|
|
1049
|
-
stringToUTF8(string, buffer, Infinity);
|
|
1050
|
-
if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character.
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
function writeArrayToMemory(array, buffer) {
|
|
1054
|
-
assert(array.length >= 0, 'writeArrayToMemory array must have a length (should be an array or typed array)')
|
|
1055
|
-
HEAP8.set(array, buffer);
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
/** @param {boolean=} dontAddNull */
|
|
1059
|
-
function writeAsciiToMemory(str, buffer, dontAddNull) {
|
|
1060
|
-
for (var i = 0; i < str.length; ++i) {
|
|
1061
|
-
assert(str.charCodeAt(i) === str.charCodeAt(i)&0xff);
|
|
1062
|
-
HEAP8[((buffer++)>>0)]=str.charCodeAt(i);
|
|
1063
|
-
}
|
|
1064
|
-
// Null-terminate the pointer to the HEAP.
|
|
1065
|
-
if (!dontAddNull) HEAP8[((buffer)>>0)]=0;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
// end include: runtime_strings_extra.js
|
|
1069
|
-
// Memory management
|
|
1070
|
-
|
|
1071
|
-
function alignUp(x, multiple) {
|
|
1072
|
-
if (x % multiple > 0) {
|
|
1073
|
-
x += multiple - (x % multiple);
|
|
1074
|
-
}
|
|
1075
|
-
return x;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
var HEAP,
|
|
1079
|
-
/** @type {ArrayBuffer} */
|
|
1080
|
-
buffer,
|
|
1081
|
-
/** @type {Int8Array} */
|
|
1082
|
-
HEAP8,
|
|
1083
|
-
/** @type {Uint8Array} */
|
|
1084
|
-
HEAPU8,
|
|
1085
|
-
/** @type {Int16Array} */
|
|
1086
|
-
HEAP16,
|
|
1087
|
-
/** @type {Uint16Array} */
|
|
1088
|
-
HEAPU16,
|
|
1089
|
-
/** @type {Int32Array} */
|
|
1090
|
-
HEAP32,
|
|
1091
|
-
/** @type {Uint32Array} */
|
|
1092
|
-
HEAPU32,
|
|
1093
|
-
/** @type {Float32Array} */
|
|
1094
|
-
HEAPF32,
|
|
1095
|
-
/** @type {Float64Array} */
|
|
1096
|
-
HEAPF64;
|
|
1097
|
-
|
|
1098
|
-
function updateGlobalBufferAndViews(buf) {
|
|
1099
|
-
buffer = buf;
|
|
1100
|
-
Module['HEAP8'] = HEAP8 = new Int8Array(buf);
|
|
1101
|
-
Module['HEAP16'] = HEAP16 = new Int16Array(buf);
|
|
1102
|
-
Module['HEAP32'] = HEAP32 = new Int32Array(buf);
|
|
1103
|
-
Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf);
|
|
1104
|
-
Module['HEAPU16'] = HEAPU16 = new Uint16Array(buf);
|
|
1105
|
-
Module['HEAPU32'] = HEAPU32 = new Uint32Array(buf);
|
|
1106
|
-
Module['HEAPF32'] = HEAPF32 = new Float32Array(buf);
|
|
1107
|
-
Module['HEAPF64'] = HEAPF64 = new Float64Array(buf);
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
var TOTAL_STACK = 5242880;
|
|
1111
|
-
if (Module['TOTAL_STACK']) assert(TOTAL_STACK === Module['TOTAL_STACK'], 'the stack size can no longer be determined at runtime')
|
|
1112
|
-
|
|
1113
|
-
var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216;if (!Object.getOwnPropertyDescriptor(Module, 'INITIAL_MEMORY')) Object.defineProperty(Module, 'INITIAL_MEMORY', { configurable: true, get: function() { abort('Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)') } });
|
|
1114
|
-
|
|
1115
|
-
assert(INITIAL_MEMORY >= TOTAL_STACK, 'INITIAL_MEMORY should be larger than TOTAL_STACK, was ' + INITIAL_MEMORY + '! (TOTAL_STACK=' + TOTAL_STACK + ')');
|
|
1116
|
-
|
|
1117
|
-
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
|
|
1118
|
-
assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined,
|
|
1119
|
-
'JS engine does not provide full typed array support');
|
|
1120
|
-
|
|
1121
|
-
// In non-standalone/normal mode, we create the memory here.
|
|
1122
|
-
// include: runtime_init_memory.js
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
// Create the main memory. (Note: this isn't used in STANDALONE_WASM mode since the wasm
|
|
1126
|
-
// memory is created in the wasm, not in JS.)
|
|
1127
|
-
|
|
1128
|
-
if (Module['wasmMemory']) {
|
|
1129
|
-
wasmMemory = Module['wasmMemory'];
|
|
1130
|
-
} else
|
|
1131
|
-
{
|
|
1132
|
-
wasmMemory = new WebAssembly.Memory({
|
|
1133
|
-
'initial': INITIAL_MEMORY / 65536
|
|
1134
|
-
,
|
|
1135
|
-
'maximum': INITIAL_MEMORY / 65536
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
if (wasmMemory) {
|
|
1140
|
-
buffer = wasmMemory.buffer;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
// If the user provides an incorrect length, just use that length instead rather than providing the user to
|
|
1144
|
-
// specifically provide the memory length with Module['INITIAL_MEMORY'].
|
|
1145
|
-
INITIAL_MEMORY = buffer.byteLength;
|
|
1146
|
-
assert(INITIAL_MEMORY % 65536 === 0);
|
|
1147
|
-
updateGlobalBufferAndViews(buffer);
|
|
1148
|
-
|
|
1149
|
-
// end include: runtime_init_memory.js
|
|
1150
|
-
|
|
1151
|
-
// include: runtime_init_table.js
|
|
1152
|
-
// In regular non-RELOCATABLE mode the table is exported
|
|
1153
|
-
// from the wasm module and this will be assigned once
|
|
1154
|
-
// the exports are available.
|
|
1155
|
-
var wasmTable;
|
|
1156
|
-
|
|
1157
|
-
// end include: runtime_init_table.js
|
|
1158
|
-
// include: runtime_stack_check.js
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
|
|
1162
|
-
function writeStackCookie() {
|
|
1163
|
-
var max = _emscripten_stack_get_end();
|
|
1164
|
-
assert((max & 3) == 0);
|
|
1165
|
-
// The stack grows downwards
|
|
1166
|
-
HEAPU32[(max >> 2)+1] = 0x2135467;
|
|
1167
|
-
HEAPU32[(max >> 2)+2] = 0x89BACDFE;
|
|
1168
|
-
// Also test the global address 0 for integrity.
|
|
1169
|
-
HEAP32[0] = 0x63736d65; /* 'emsc' */
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
function checkStackCookie() {
|
|
1173
|
-
if (ABORT) return;
|
|
1174
|
-
var max = _emscripten_stack_get_end();
|
|
1175
|
-
var cookie1 = HEAPU32[(max >> 2)+1];
|
|
1176
|
-
var cookie2 = HEAPU32[(max >> 2)+2];
|
|
1177
|
-
if (cookie1 != 0x2135467 || cookie2 != 0x89BACDFE) {
|
|
1178
|
-
abort('Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x' + cookie2.toString(16) + ' ' + cookie1.toString(16));
|
|
1179
|
-
}
|
|
1180
|
-
// Also test the global address 0 for integrity.
|
|
1181
|
-
if (HEAP32[0] !== 0x63736d65 /* 'emsc' */) abort('Runtime error: The application has corrupted its heap memory area (address zero)!');
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
// end include: runtime_stack_check.js
|
|
1185
|
-
// include: runtime_assertions.js
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
// Endianness check (note: assumes compiler arch was little-endian)
|
|
1189
|
-
(function() {
|
|
1190
|
-
var h16 = new Int16Array(1);
|
|
1191
|
-
var h8 = new Int8Array(h16.buffer);
|
|
1192
|
-
h16[0] = 0x6373;
|
|
1193
|
-
if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian!';
|
|
1194
|
-
})();
|
|
1195
|
-
|
|
1196
|
-
function abortFnPtrError(ptr, sig) {
|
|
1197
|
-
abort("Invalid function pointer " + ptr + " called with signature '" + sig + "'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). Build with ASSERTIONS=2 for more info.");
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
// end include: runtime_assertions.js
|
|
1201
|
-
var __ATPRERUN__ = []; // functions called before the runtime is initialized
|
|
1202
|
-
var __ATINIT__ = []; // functions called during startup
|
|
1203
|
-
var __ATMAIN__ = []; // functions called when main() is to be run
|
|
1204
|
-
var __ATEXIT__ = []; // functions called during shutdown
|
|
1205
|
-
var __ATPOSTRUN__ = []; // functions called after the main() is called
|
|
1206
|
-
|
|
1207
|
-
var runtimeInitialized = false;
|
|
1208
|
-
var runtimeExited = false;
|
|
1209
|
-
|
|
1210
|
-
function preRun() {
|
|
1211
|
-
|
|
1212
|
-
if (Module['preRun']) {
|
|
1213
|
-
if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
|
|
1214
|
-
while (Module['preRun'].length) {
|
|
1215
|
-
addOnPreRun(Module['preRun'].shift());
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
callRuntimeCallbacks(__ATPRERUN__);
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
function initRuntime() {
|
|
1223
|
-
checkStackCookie();
|
|
1224
|
-
assert(!runtimeInitialized);
|
|
1225
|
-
runtimeInitialized = true;
|
|
1226
|
-
|
|
1227
|
-
callRuntimeCallbacks(__ATINIT__);
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
function preMain() {
|
|
1231
|
-
checkStackCookie();
|
|
1232
|
-
|
|
1233
|
-
callRuntimeCallbacks(__ATMAIN__);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
function exitRuntime() {
|
|
1237
|
-
checkStackCookie();
|
|
1238
|
-
runtimeExited = true;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
function postRun() {
|
|
1242
|
-
checkStackCookie();
|
|
1243
|
-
|
|
1244
|
-
if (Module['postRun']) {
|
|
1245
|
-
if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
|
|
1246
|
-
while (Module['postRun'].length) {
|
|
1247
|
-
addOnPostRun(Module['postRun'].shift());
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
callRuntimeCallbacks(__ATPOSTRUN__);
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
function addOnPreRun(cb) {
|
|
1255
|
-
__ATPRERUN__.unshift(cb);
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
function addOnInit(cb) {
|
|
1259
|
-
__ATINIT__.unshift(cb);
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
function addOnPreMain(cb) {
|
|
1263
|
-
__ATMAIN__.unshift(cb);
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
function addOnExit(cb) {
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
function addOnPostRun(cb) {
|
|
1270
|
-
__ATPOSTRUN__.unshift(cb);
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
// include: runtime_math.js
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
|
|
1277
|
-
|
|
1278
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround
|
|
1279
|
-
|
|
1280
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
|
|
1281
|
-
|
|
1282
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
|
|
1283
|
-
|
|
1284
|
-
assert(Math.imul, 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
|
|
1285
|
-
assert(Math.fround, 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
|
|
1286
|
-
assert(Math.clz32, 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
|
|
1287
|
-
assert(Math.trunc, 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');
|
|
1288
|
-
|
|
1289
|
-
// end include: runtime_math.js
|
|
1290
|
-
// A counter of dependencies for calling run(). If we need to
|
|
1291
|
-
// do asynchronous work before running, increment this and
|
|
1292
|
-
// decrement it. Incrementing must happen in a place like
|
|
1293
|
-
// Module.preRun (used by emcc to add file preloading).
|
|
1294
|
-
// Note that you can add dependencies in preRun, even though
|
|
1295
|
-
// it happens right before run - run will be postponed until
|
|
1296
|
-
// the dependencies are met.
|
|
1297
|
-
var runDependencies = 0;
|
|
1298
|
-
var runDependencyWatcher = null;
|
|
1299
|
-
var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
|
|
1300
|
-
var runDependencyTracking = {};
|
|
1301
|
-
|
|
1302
|
-
function getUniqueRunDependency(id) {
|
|
1303
|
-
var orig = id;
|
|
1304
|
-
while (1) {
|
|
1305
|
-
if (!runDependencyTracking[id]) return id;
|
|
1306
|
-
id = orig + Math.random();
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
function addRunDependency(id) {
|
|
1311
|
-
runDependencies++;
|
|
1312
|
-
|
|
1313
|
-
if (Module['monitorRunDependencies']) {
|
|
1314
|
-
Module['monitorRunDependencies'](runDependencies);
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
if (id) {
|
|
1318
|
-
assert(!runDependencyTracking[id]);
|
|
1319
|
-
runDependencyTracking[id] = 1;
|
|
1320
|
-
if (runDependencyWatcher === null && typeof setInterval !== 'undefined') {
|
|
1321
|
-
// Check for missing dependencies every few seconds
|
|
1322
|
-
runDependencyWatcher = setInterval(function() {
|
|
1323
|
-
if (ABORT) {
|
|
1324
|
-
clearInterval(runDependencyWatcher);
|
|
1325
|
-
runDependencyWatcher = null;
|
|
1326
|
-
return;
|
|
1327
|
-
}
|
|
1328
|
-
var shown = false;
|
|
1329
|
-
for (var dep in runDependencyTracking) {
|
|
1330
|
-
if (!shown) {
|
|
1331
|
-
shown = true;
|
|
1332
|
-
err('still waiting on run dependencies:');
|
|
1333
|
-
}
|
|
1334
|
-
err('dependency: ' + dep);
|
|
1335
|
-
}
|
|
1336
|
-
if (shown) {
|
|
1337
|
-
err('(end of list)');
|
|
1338
|
-
}
|
|
1339
|
-
}, 10000);
|
|
1340
|
-
}
|
|
1341
|
-
} else {
|
|
1342
|
-
err('warning: run dependency added without ID');
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
function removeRunDependency(id) {
|
|
1347
|
-
runDependencies--;
|
|
1348
|
-
|
|
1349
|
-
if (Module['monitorRunDependencies']) {
|
|
1350
|
-
Module['monitorRunDependencies'](runDependencies);
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
if (id) {
|
|
1354
|
-
assert(runDependencyTracking[id]);
|
|
1355
|
-
delete runDependencyTracking[id];
|
|
1356
|
-
} else {
|
|
1357
|
-
err('warning: run dependency removed without ID');
|
|
1358
|
-
}
|
|
1359
|
-
if (runDependencies == 0) {
|
|
1360
|
-
if (runDependencyWatcher !== null) {
|
|
1361
|
-
clearInterval(runDependencyWatcher);
|
|
1362
|
-
runDependencyWatcher = null;
|
|
1363
|
-
}
|
|
1364
|
-
if (dependenciesFulfilled) {
|
|
1365
|
-
var callback = dependenciesFulfilled;
|
|
1366
|
-
dependenciesFulfilled = null;
|
|
1367
|
-
callback(); // can add another dependenciesFulfilled
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
Module["preloadedImages"] = {}; // maps url to image data
|
|
1373
|
-
Module["preloadedAudios"] = {}; // maps url to audio data
|
|
1374
|
-
|
|
1375
|
-
/** @param {string|number=} what */
|
|
1376
|
-
function abort(what) {
|
|
1377
|
-
if (Module['onAbort']) {
|
|
1378
|
-
Module['onAbort'](what);
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
what += '';
|
|
1382
|
-
err(what);
|
|
1383
|
-
|
|
1384
|
-
ABORT = true;
|
|
1385
|
-
EXITSTATUS = 1;
|
|
1386
|
-
|
|
1387
|
-
var output = 'abort(' + what + ') at ' + stackTrace();
|
|
1388
|
-
what = output;
|
|
1389
|
-
|
|
1390
|
-
// Use a wasm runtime error, because a JS error might be seen as a foreign
|
|
1391
|
-
// exception, which means we'd run destructors on it. We need the error to
|
|
1392
|
-
// simply make the program stop.
|
|
1393
|
-
var e = new WebAssembly.RuntimeError(what);
|
|
1394
|
-
|
|
1395
|
-
// Throw the error whether or not MODULARIZE is set because abort is used
|
|
1396
|
-
// in code paths apart from instantiation where an exception is expected
|
|
1397
|
-
// to be thrown when abort is called.
|
|
1398
|
-
throw e;
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
// {{MEM_INITIALIZER}}
|
|
1402
|
-
|
|
1403
|
-
// include: memoryprofiler.js
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
// end include: memoryprofiler.js
|
|
1407
|
-
// show errors on likely calls to FS when it was not included
|
|
1408
|
-
var FS = {
|
|
1409
|
-
error: function() {
|
|
1410
|
-
abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1');
|
|
1411
|
-
},
|
|
1412
|
-
init: function() { FS.error() },
|
|
1413
|
-
createDataFile: function() { FS.error() },
|
|
1414
|
-
createPreloadedFile: function() { FS.error() },
|
|
1415
|
-
createLazyFile: function() { FS.error() },
|
|
1416
|
-
open: function() { FS.error() },
|
|
1417
|
-
mkdev: function() { FS.error() },
|
|
1418
|
-
registerDevice: function() { FS.error() },
|
|
1419
|
-
analyzePath: function() { FS.error() },
|
|
1420
|
-
loadFilesFromDB: function() { FS.error() },
|
|
1421
|
-
|
|
1422
|
-
ErrnoError: function ErrnoError() { FS.error() },
|
|
1423
|
-
};
|
|
1424
|
-
Module['FS_createDataFile'] = FS.createDataFile;
|
|
1425
|
-
Module['FS_createPreloadedFile'] = FS.createPreloadedFile;
|
|
1426
|
-
|
|
1427
|
-
// include: URIUtils.js
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
function hasPrefix(str, prefix) {
|
|
1431
|
-
return String.prototype.startsWith ?
|
|
1432
|
-
str.startsWith(prefix) :
|
|
1433
|
-
str.indexOf(prefix) === 0;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
// Prefix of data URIs emitted by SINGLE_FILE and related options.
|
|
1437
|
-
var dataURIPrefix = 'data:application/octet-stream;base64,';
|
|
1438
|
-
|
|
1439
|
-
// Indicates whether filename is a base64 data URI.
|
|
1440
|
-
function isDataURI(filename) {
|
|
1441
|
-
return hasPrefix(filename, dataURIPrefix);
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
var fileURIPrefix = "file://";
|
|
1445
|
-
|
|
1446
|
-
// Indicates whether filename is delivered via file protocol (as opposed to http/https)
|
|
1447
|
-
function isFileURI(filename) {
|
|
1448
|
-
return hasPrefix(filename, fileURIPrefix);
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
// end include: URIUtils.js
|
|
1452
|
-
function createExportWrapper(name, fixedasm) {
|
|
1453
|
-
return function() {
|
|
1454
|
-
var displayName = name;
|
|
1455
|
-
var asm = fixedasm;
|
|
1456
|
-
if (!fixedasm) {
|
|
1457
|
-
asm = Module['asm'];
|
|
1458
|
-
}
|
|
1459
|
-
assert(runtimeInitialized, 'native function `' + displayName + '` called before runtime initialization');
|
|
1460
|
-
assert(!runtimeExited, 'native function `' + displayName + '` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)');
|
|
1461
|
-
if (!asm[name]) {
|
|
1462
|
-
assert(asm[name], 'exported native function `' + displayName + '` not found');
|
|
1463
|
-
}
|
|
1464
|
-
return asm[name].apply(null, arguments);
|
|
1465
|
-
};
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
var wasmBinaryFile = 're2.wasm';
|
|
1469
|
-
if (!isDataURI(wasmBinaryFile)) {
|
|
1470
|
-
wasmBinaryFile = locateFile(wasmBinaryFile);
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
function getBinary() {
|
|
1474
|
-
try {
|
|
1475
|
-
if (wasmBinary) {
|
|
1476
|
-
return new Uint8Array(wasmBinary);
|
|
1477
|
-
}
|
|
1478
|
-
|
|
1479
|
-
if (readBinary) {
|
|
1480
|
-
return readBinary(wasmBinaryFile);
|
|
1481
|
-
} else {
|
|
1482
|
-
throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)";
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
catch (err) {
|
|
1486
|
-
abort(err);
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
function getBinaryPromise() {
|
|
1491
|
-
// If we don't have the binary yet, and have the Fetch api, use that;
|
|
1492
|
-
// in some environments, like Electron's render process, Fetch api may be present, but have a different context than expected, let's only use it on the Web
|
|
1493
|
-
if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && typeof fetch === 'function'
|
|
1494
|
-
// Let's not use fetch to get objects over file:// as it's most likely Cordova which doesn't support fetch for file://
|
|
1495
|
-
&& !isFileURI(wasmBinaryFile)
|
|
1496
|
-
) {
|
|
1497
|
-
return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function(response) {
|
|
1498
|
-
if (!response['ok']) {
|
|
1499
|
-
throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
|
|
1500
|
-
}
|
|
1501
|
-
return response['arrayBuffer']();
|
|
1502
|
-
}).catch(function () {
|
|
1503
|
-
return getBinary();
|
|
1504
|
-
});
|
|
1505
|
-
}
|
|
1506
|
-
// Otherwise, getBinary should be able to get it synchronously
|
|
1507
|
-
return Promise.resolve().then(getBinary);
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
// Create the wasm instance.
|
|
1511
|
-
// Receives the wasm imports, returns the exports.
|
|
1512
|
-
function createWasm() {
|
|
1513
|
-
// prepare imports
|
|
1514
|
-
var info = {
|
|
1515
|
-
'env': asmLibraryArg,
|
|
1516
|
-
'wasi_snapshot_preview1': asmLibraryArg,
|
|
1517
|
-
};
|
|
1518
|
-
// Load the wasm module and create an instance of using native support in the JS engine.
|
|
1519
|
-
// handle a generated wasm instance, receiving its exports and
|
|
1520
|
-
// performing other necessary setup
|
|
1521
|
-
/** @param {WebAssembly.Module=} module*/
|
|
1522
|
-
function receiveInstance(instance, module) {
|
|
1523
|
-
var exports = instance.exports;
|
|
1524
|
-
|
|
1525
|
-
Module['asm'] = exports;
|
|
1526
|
-
|
|
1527
|
-
wasmTable = Module['asm']['__indirect_function_table'];
|
|
1528
|
-
assert(wasmTable, "table not found in wasm exports");
|
|
1529
|
-
|
|
1530
|
-
removeRunDependency('wasm-instantiate');
|
|
1531
|
-
}
|
|
1532
|
-
// we can't run yet (except in a pthread, where we have a custom sync instantiator)
|
|
1533
|
-
addRunDependency('wasm-instantiate');
|
|
1534
|
-
|
|
1535
|
-
// Async compilation can be confusing when an error on the page overwrites Module
|
|
1536
|
-
// (for example, if the order of elements is wrong, and the one defining Module is
|
|
1537
|
-
// later), so we save Module and check it later.
|
|
1538
|
-
var trueModule = Module;
|
|
1539
|
-
function receiveInstantiatedSource(output) {
|
|
1540
|
-
// 'output' is a WebAssemblyInstantiatedSource object which has both the module and instance.
|
|
1541
|
-
// receiveInstance() will swap in the exports (to Module.asm) so they can be called
|
|
1542
|
-
assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');
|
|
1543
|
-
trueModule = null;
|
|
1544
|
-
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
|
|
1545
|
-
// When the regression is fixed, can restore the above USE_PTHREADS-enabled path.
|
|
1546
|
-
receiveInstance(output['instance']);
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
function instantiateArrayBuffer(receiver) {
|
|
1550
|
-
return getBinaryPromise().then(function(binary) {
|
|
1551
|
-
return WebAssembly.instantiate(binary, info);
|
|
1552
|
-
}).then(receiver, function(reason) {
|
|
1553
|
-
err('failed to asynchronously prepare wasm: ' + reason);
|
|
1554
|
-
|
|
1555
|
-
abort(reason);
|
|
1556
|
-
});
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
// Prefer streaming instantiation if available.
|
|
1560
|
-
function instantiateSync() {
|
|
1561
|
-
var instance;
|
|
1562
|
-
var module;
|
|
1563
|
-
var binary;
|
|
1564
|
-
try {
|
|
1565
|
-
binary = getBinary();
|
|
1566
|
-
module = new WebAssembly.Module(binary);
|
|
1567
|
-
instance = new WebAssembly.Instance(module, info);
|
|
1568
|
-
} catch (e) {
|
|
1569
|
-
var str = e.toString();
|
|
1570
|
-
err('failed to compile wasm module: ' + str);
|
|
1571
|
-
if (str.indexOf('imported Memory') >= 0 ||
|
|
1572
|
-
str.indexOf('memory import') >= 0) {
|
|
1573
|
-
err('Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time).');
|
|
1574
|
-
}
|
|
1575
|
-
throw e;
|
|
1576
|
-
}
|
|
1577
|
-
receiveInstance(instance, module);
|
|
1578
|
-
}
|
|
1579
|
-
// User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
|
|
1580
|
-
// to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel
|
|
1581
|
-
// to any other async startup actions they are performing.
|
|
1582
|
-
if (Module['instantiateWasm']) {
|
|
1583
|
-
try {
|
|
1584
|
-
var exports = Module['instantiateWasm'](info, receiveInstance);
|
|
1585
|
-
return exports;
|
|
1586
|
-
} catch(e) {
|
|
1587
|
-
err('Module.instantiateWasm callback failed with error: ' + e);
|
|
1588
|
-
return false;
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
instantiateSync();
|
|
1593
|
-
return Module['asm']; // exports were assigned here
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
// Globals used by JS i64 conversions
|
|
1597
|
-
var tempDouble;
|
|
1598
|
-
var tempI64;
|
|
1599
|
-
|
|
1600
|
-
// === Body ===
|
|
1601
|
-
|
|
1602
|
-
var ASM_CONSTS = {
|
|
1603
|
-
|
|
1604
|
-
};
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
function abortStackOverflow(allocSize) {
|
|
1612
|
-
abort('Stack overflow! Attempted to allocate ' + allocSize + ' bytes on the stack, but stack has only ' + (_emscripten_stack_get_free() + allocSize) + ' bytes available!');
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
function callRuntimeCallbacks(callbacks) {
|
|
1616
|
-
while(callbacks.length > 0) {
|
|
1617
|
-
var callback = callbacks.shift();
|
|
1618
|
-
if (typeof callback == 'function') {
|
|
1619
|
-
callback(Module); // Pass the module as the first argument.
|
|
1620
|
-
continue;
|
|
1621
|
-
}
|
|
1622
|
-
var func = callback.func;
|
|
1623
|
-
if (typeof func === 'number') {
|
|
1624
|
-
if (callback.arg === undefined) {
|
|
1625
|
-
wasmTable.get(func)();
|
|
1626
|
-
} else {
|
|
1627
|
-
wasmTable.get(func)(callback.arg);
|
|
1628
|
-
}
|
|
1629
|
-
} else {
|
|
1630
|
-
func(callback.arg === undefined ? null : callback.arg);
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
function demangle(func) {
|
|
1636
|
-
warnOnce('warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling');
|
|
1637
|
-
return func;
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
function demangleAll(text) {
|
|
1641
|
-
var regex =
|
|
1642
|
-
/\b_Z[\w\d_]+/g;
|
|
1643
|
-
return text.replace(regex,
|
|
1644
|
-
function(x) {
|
|
1645
|
-
var y = demangle(x);
|
|
1646
|
-
return x === y ? x : (y + ' [' + x + ']');
|
|
1647
|
-
});
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
function dynCallLegacy(sig, ptr, args) {
|
|
1651
|
-
assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
|
|
1652
|
-
if (args && args.length) {
|
|
1653
|
-
// j (64-bit integer) must be passed in as two numbers [low 32, high 32].
|
|
1654
|
-
assert(args.length === sig.substring(1).replace(/j/g, '--').length);
|
|
1655
|
-
} else {
|
|
1656
|
-
assert(sig.length == 1);
|
|
1657
|
-
}
|
|
1658
|
-
if (args && args.length) {
|
|
1659
|
-
return Module['dynCall_' + sig].apply(null, [ptr].concat(args));
|
|
1660
|
-
}
|
|
1661
|
-
return Module['dynCall_' + sig].call(null, ptr);
|
|
1662
|
-
}
|
|
1663
|
-
function dynCall(sig, ptr, args) {
|
|
1664
|
-
// Without WASM_BIGINT support we cannot directly call function with i64 as
|
|
1665
|
-
// part of thier signature, so we rely the dynCall functions generated by
|
|
1666
|
-
// wasm-emscripten-finalize
|
|
1667
|
-
if (sig.indexOf('j') != -1) {
|
|
1668
|
-
return dynCallLegacy(sig, ptr, args);
|
|
1669
|
-
}
|
|
1670
|
-
assert(wasmTable.get(ptr), 'missing table entry in dynCall: ' + ptr);
|
|
1671
|
-
return wasmTable.get(ptr).apply(null, args)
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
function jsStackTrace() {
|
|
1675
|
-
var error = new Error();
|
|
1676
|
-
if (!error.stack) {
|
|
1677
|
-
// IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown,
|
|
1678
|
-
// so try that as a special-case.
|
|
1679
|
-
try {
|
|
1680
|
-
throw new Error();
|
|
1681
|
-
} catch(e) {
|
|
1682
|
-
error = e;
|
|
1683
|
-
}
|
|
1684
|
-
if (!error.stack) {
|
|
1685
|
-
return '(no stack trace available)';
|
|
1686
|
-
}
|
|
1687
|
-
}
|
|
1688
|
-
return error.stack.toString();
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
function stackTrace() {
|
|
1692
|
-
var js = jsStackTrace();
|
|
1693
|
-
if (Module['extraStackTrace']) js += '\n' + Module['extraStackTrace']();
|
|
1694
|
-
return demangleAll(js);
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
function ___assert_fail(condition, filename, line, func) {
|
|
1698
|
-
abort('Assertion failed: ' + UTF8ToString(condition) + ', at: ' + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};
|
|
1702
|
-
function ___cxa_allocate_exception(size) {
|
|
1703
|
-
// Thrown object is prepended by exception metadata block
|
|
1704
|
-
return _malloc(size + ExceptionInfoAttrs.SIZE) + ExceptionInfoAttrs.SIZE;
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1707
|
-
function _atexit(func, arg) {
|
|
1708
|
-
}
|
|
1709
|
-
function ___cxa_atexit(a0,a1
|
|
1710
|
-
) {
|
|
1711
|
-
return _atexit(a0,a1);
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
function ExceptionInfo(excPtr) {
|
|
1715
|
-
this.excPtr = excPtr;
|
|
1716
|
-
this.ptr = excPtr - ExceptionInfoAttrs.SIZE;
|
|
1717
|
-
|
|
1718
|
-
this.set_type = function(type) {
|
|
1719
|
-
HEAP32[(((this.ptr)+(ExceptionInfoAttrs.TYPE_OFFSET))>>2)]=type;
|
|
1720
|
-
};
|
|
1721
|
-
|
|
1722
|
-
this.get_type = function() {
|
|
1723
|
-
return HEAP32[(((this.ptr)+(ExceptionInfoAttrs.TYPE_OFFSET))>>2)];
|
|
1724
|
-
};
|
|
1725
|
-
|
|
1726
|
-
this.set_destructor = function(destructor) {
|
|
1727
|
-
HEAP32[(((this.ptr)+(ExceptionInfoAttrs.DESTRUCTOR_OFFSET))>>2)]=destructor;
|
|
1728
|
-
};
|
|
1729
|
-
|
|
1730
|
-
this.get_destructor = function() {
|
|
1731
|
-
return HEAP32[(((this.ptr)+(ExceptionInfoAttrs.DESTRUCTOR_OFFSET))>>2)];
|
|
1732
|
-
};
|
|
1733
|
-
|
|
1734
|
-
this.set_refcount = function(refcount) {
|
|
1735
|
-
HEAP32[(((this.ptr)+(ExceptionInfoAttrs.REFCOUNT_OFFSET))>>2)]=refcount;
|
|
1736
|
-
};
|
|
1737
|
-
|
|
1738
|
-
this.set_caught = function (caught) {
|
|
1739
|
-
caught = caught ? 1 : 0;
|
|
1740
|
-
HEAP8[(((this.ptr)+(ExceptionInfoAttrs.CAUGHT_OFFSET))>>0)]=caught;
|
|
1741
|
-
};
|
|
1742
|
-
|
|
1743
|
-
this.get_caught = function () {
|
|
1744
|
-
return HEAP8[(((this.ptr)+(ExceptionInfoAttrs.CAUGHT_OFFSET))>>0)] != 0;
|
|
1745
|
-
};
|
|
1746
|
-
|
|
1747
|
-
this.set_rethrown = function (rethrown) {
|
|
1748
|
-
rethrown = rethrown ? 1 : 0;
|
|
1749
|
-
HEAP8[(((this.ptr)+(ExceptionInfoAttrs.RETHROWN_OFFSET))>>0)]=rethrown;
|
|
1750
|
-
};
|
|
1751
|
-
|
|
1752
|
-
this.get_rethrown = function () {
|
|
1753
|
-
return HEAP8[(((this.ptr)+(ExceptionInfoAttrs.RETHROWN_OFFSET))>>0)] != 0;
|
|
1754
|
-
};
|
|
1755
|
-
|
|
1756
|
-
// Initialize native structure fields. Should be called once after allocated.
|
|
1757
|
-
this.init = function(type, destructor) {
|
|
1758
|
-
this.set_type(type);
|
|
1759
|
-
this.set_destructor(destructor);
|
|
1760
|
-
this.set_refcount(0);
|
|
1761
|
-
this.set_caught(false);
|
|
1762
|
-
this.set_rethrown(false);
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
this.add_ref = function() {
|
|
1766
|
-
var value = HEAP32[(((this.ptr)+(ExceptionInfoAttrs.REFCOUNT_OFFSET))>>2)];
|
|
1767
|
-
HEAP32[(((this.ptr)+(ExceptionInfoAttrs.REFCOUNT_OFFSET))>>2)]=value + 1;
|
|
1768
|
-
};
|
|
1769
|
-
|
|
1770
|
-
// Returns true if last reference released.
|
|
1771
|
-
this.release_ref = function() {
|
|
1772
|
-
var prev = HEAP32[(((this.ptr)+(ExceptionInfoAttrs.REFCOUNT_OFFSET))>>2)];
|
|
1773
|
-
HEAP32[(((this.ptr)+(ExceptionInfoAttrs.REFCOUNT_OFFSET))>>2)]=prev - 1;
|
|
1774
|
-
assert(prev > 0);
|
|
1775
|
-
return prev === 1;
|
|
1776
|
-
};
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
var exceptionLast=0;
|
|
1780
|
-
|
|
1781
|
-
var uncaughtExceptionCount=0;
|
|
1782
|
-
function ___cxa_throw(ptr, type, destructor) {
|
|
1783
|
-
var info = new ExceptionInfo(ptr);
|
|
1784
|
-
// Initialize ExceptionInfo content after it was allocated in __cxa_allocate_exception.
|
|
1785
|
-
info.init(type, destructor);
|
|
1786
|
-
exceptionLast = ptr;
|
|
1787
|
-
uncaughtExceptionCount++;
|
|
1788
|
-
throw ptr + " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
function getShiftFromSize(size) {
|
|
1792
|
-
switch (size) {
|
|
1793
|
-
case 1: return 0;
|
|
1794
|
-
case 2: return 1;
|
|
1795
|
-
case 4: return 2;
|
|
1796
|
-
case 8: return 3;
|
|
1797
|
-
default:
|
|
1798
|
-
throw new TypeError('Unknown type size: ' + size);
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
function embind_init_charCodes() {
|
|
1803
|
-
var codes = new Array(256);
|
|
1804
|
-
for (var i = 0; i < 256; ++i) {
|
|
1805
|
-
codes[i] = String.fromCharCode(i);
|
|
1806
|
-
}
|
|
1807
|
-
embind_charCodes = codes;
|
|
1808
|
-
}
|
|
1809
|
-
var embind_charCodes=undefined;
|
|
1810
|
-
function readLatin1String(ptr) {
|
|
1811
|
-
var ret = "";
|
|
1812
|
-
var c = ptr;
|
|
1813
|
-
while (HEAPU8[c]) {
|
|
1814
|
-
ret += embind_charCodes[HEAPU8[c++]];
|
|
1815
|
-
}
|
|
1816
|
-
return ret;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
var awaitingDependencies={};
|
|
1820
|
-
|
|
1821
|
-
var registeredTypes={};
|
|
1822
|
-
|
|
1823
|
-
var typeDependencies={};
|
|
1824
|
-
|
|
1825
|
-
var char_0=48;
|
|
1826
|
-
|
|
1827
|
-
var char_9=57;
|
|
1828
|
-
function makeLegalFunctionName(name) {
|
|
1829
|
-
if (undefined === name) {
|
|
1830
|
-
return '_unknown';
|
|
1831
|
-
}
|
|
1832
|
-
name = name.replace(/[^a-zA-Z0-9_]/g, '$');
|
|
1833
|
-
var f = name.charCodeAt(0);
|
|
1834
|
-
if (f >= char_0 && f <= char_9) {
|
|
1835
|
-
return '_' + name;
|
|
1836
|
-
} else {
|
|
1837
|
-
return name;
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
function createNamedFunction(name, body) {
|
|
1841
|
-
name = makeLegalFunctionName(name);
|
|
1842
|
-
/*jshint evil:true*/
|
|
1843
|
-
return new Function(
|
|
1844
|
-
"body",
|
|
1845
|
-
"return function " + name + "() {\n" +
|
|
1846
|
-
" \"use strict\";" +
|
|
1847
|
-
" return body.apply(this, arguments);\n" +
|
|
1848
|
-
"};\n"
|
|
1849
|
-
)(body);
|
|
1850
|
-
}
|
|
1851
|
-
function extendError(baseErrorType, errorName) {
|
|
1852
|
-
var errorClass = createNamedFunction(errorName, function(message) {
|
|
1853
|
-
this.name = errorName;
|
|
1854
|
-
this.message = message;
|
|
1855
|
-
|
|
1856
|
-
var stack = (new Error(message)).stack;
|
|
1857
|
-
if (stack !== undefined) {
|
|
1858
|
-
this.stack = this.toString() + '\n' +
|
|
1859
|
-
stack.replace(/^Error(:[^\n]*)?\n/, '');
|
|
1860
|
-
}
|
|
1861
|
-
});
|
|
1862
|
-
errorClass.prototype = Object.create(baseErrorType.prototype);
|
|
1863
|
-
errorClass.prototype.constructor = errorClass;
|
|
1864
|
-
errorClass.prototype.toString = function() {
|
|
1865
|
-
if (this.message === undefined) {
|
|
1866
|
-
return this.name;
|
|
1867
|
-
} else {
|
|
1868
|
-
return this.name + ': ' + this.message;
|
|
1869
|
-
}
|
|
1870
|
-
};
|
|
1871
|
-
|
|
1872
|
-
return errorClass;
|
|
1873
|
-
}
|
|
1874
|
-
var BindingError=undefined;
|
|
1875
|
-
function throwBindingError(message) {
|
|
1876
|
-
throw new BindingError(message);
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
var InternalError=undefined;
|
|
1880
|
-
function throwInternalError(message) {
|
|
1881
|
-
throw new InternalError(message);
|
|
1882
|
-
}
|
|
1883
|
-
function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) {
|
|
1884
|
-
myTypes.forEach(function(type) {
|
|
1885
|
-
typeDependencies[type] = dependentTypes;
|
|
1886
|
-
});
|
|
1887
|
-
|
|
1888
|
-
function onComplete(typeConverters) {
|
|
1889
|
-
var myTypeConverters = getTypeConverters(typeConverters);
|
|
1890
|
-
if (myTypeConverters.length !== myTypes.length) {
|
|
1891
|
-
throwInternalError('Mismatched type converter count');
|
|
1892
|
-
}
|
|
1893
|
-
for (var i = 0; i < myTypes.length; ++i) {
|
|
1894
|
-
registerType(myTypes[i], myTypeConverters[i]);
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
var typeConverters = new Array(dependentTypes.length);
|
|
1899
|
-
var unregisteredTypes = [];
|
|
1900
|
-
var registered = 0;
|
|
1901
|
-
dependentTypes.forEach(function(dt, i) {
|
|
1902
|
-
if (registeredTypes.hasOwnProperty(dt)) {
|
|
1903
|
-
typeConverters[i] = registeredTypes[dt];
|
|
1904
|
-
} else {
|
|
1905
|
-
unregisteredTypes.push(dt);
|
|
1906
|
-
if (!awaitingDependencies.hasOwnProperty(dt)) {
|
|
1907
|
-
awaitingDependencies[dt] = [];
|
|
1908
|
-
}
|
|
1909
|
-
awaitingDependencies[dt].push(function() {
|
|
1910
|
-
typeConverters[i] = registeredTypes[dt];
|
|
1911
|
-
++registered;
|
|
1912
|
-
if (registered === unregisteredTypes.length) {
|
|
1913
|
-
onComplete(typeConverters);
|
|
1914
|
-
}
|
|
1915
|
-
});
|
|
1916
|
-
}
|
|
1917
|
-
});
|
|
1918
|
-
if (0 === unregisteredTypes.length) {
|
|
1919
|
-
onComplete(typeConverters);
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
/** @param {Object=} options */
|
|
1923
|
-
function registerType(rawType, registeredInstance, options) {
|
|
1924
|
-
options = options || {};
|
|
1925
|
-
|
|
1926
|
-
if (!('argPackAdvance' in registeredInstance)) {
|
|
1927
|
-
throw new TypeError('registerType registeredInstance requires argPackAdvance');
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
var name = registeredInstance.name;
|
|
1931
|
-
if (!rawType) {
|
|
1932
|
-
throwBindingError('type "' + name + '" must have a positive integer typeid pointer');
|
|
1933
|
-
}
|
|
1934
|
-
if (registeredTypes.hasOwnProperty(rawType)) {
|
|
1935
|
-
if (options.ignoreDuplicateRegistrations) {
|
|
1936
|
-
return;
|
|
1937
|
-
} else {
|
|
1938
|
-
throwBindingError("Cannot register type '" + name + "' twice");
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
registeredTypes[rawType] = registeredInstance;
|
|
1943
|
-
delete typeDependencies[rawType];
|
|
1944
|
-
|
|
1945
|
-
if (awaitingDependencies.hasOwnProperty(rawType)) {
|
|
1946
|
-
var callbacks = awaitingDependencies[rawType];
|
|
1947
|
-
delete awaitingDependencies[rawType];
|
|
1948
|
-
callbacks.forEach(function(cb) {
|
|
1949
|
-
cb();
|
|
1950
|
-
});
|
|
1951
|
-
}
|
|
1952
|
-
}
|
|
1953
|
-
function __embind_register_bool(rawType, name, size, trueValue, falseValue) {
|
|
1954
|
-
var shift = getShiftFromSize(size);
|
|
1955
|
-
|
|
1956
|
-
name = readLatin1String(name);
|
|
1957
|
-
registerType(rawType, {
|
|
1958
|
-
name: name,
|
|
1959
|
-
'fromWireType': function(wt) {
|
|
1960
|
-
// ambiguous emscripten ABI: sometimes return values are
|
|
1961
|
-
// true or false, and sometimes integers (0 or 1)
|
|
1962
|
-
return !!wt;
|
|
1963
|
-
},
|
|
1964
|
-
'toWireType': function(destructors, o) {
|
|
1965
|
-
return o ? trueValue : falseValue;
|
|
1966
|
-
},
|
|
1967
|
-
'argPackAdvance': 8,
|
|
1968
|
-
'readValueFromPointer': function(pointer) {
|
|
1969
|
-
// TODO: if heap is fixed (like in asm.js) this could be executed outside
|
|
1970
|
-
var heap;
|
|
1971
|
-
if (size === 1) {
|
|
1972
|
-
heap = HEAP8;
|
|
1973
|
-
} else if (size === 2) {
|
|
1974
|
-
heap = HEAP16;
|
|
1975
|
-
} else if (size === 4) {
|
|
1976
|
-
heap = HEAP32;
|
|
1977
|
-
} else {
|
|
1978
|
-
throw new TypeError("Unknown boolean type size: " + name);
|
|
1979
|
-
}
|
|
1980
|
-
return this['fromWireType'](heap[pointer >> shift]);
|
|
1981
|
-
},
|
|
1982
|
-
destructorFunction: null, // This type does not need a destructor
|
|
1983
|
-
});
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
function ClassHandle_isAliasOf(other) {
|
|
1987
|
-
if (!(this instanceof ClassHandle)) {
|
|
1988
|
-
return false;
|
|
1989
|
-
}
|
|
1990
|
-
if (!(other instanceof ClassHandle)) {
|
|
1991
|
-
return false;
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
var leftClass = this.$$.ptrType.registeredClass;
|
|
1995
|
-
var left = this.$$.ptr;
|
|
1996
|
-
var rightClass = other.$$.ptrType.registeredClass;
|
|
1997
|
-
var right = other.$$.ptr;
|
|
1998
|
-
|
|
1999
|
-
while (leftClass.baseClass) {
|
|
2000
|
-
left = leftClass.upcast(left);
|
|
2001
|
-
leftClass = leftClass.baseClass;
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
while (rightClass.baseClass) {
|
|
2005
|
-
right = rightClass.upcast(right);
|
|
2006
|
-
rightClass = rightClass.baseClass;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
return leftClass === rightClass && left === right;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
function shallowCopyInternalPointer(o) {
|
|
2013
|
-
return {
|
|
2014
|
-
count: o.count,
|
|
2015
|
-
deleteScheduled: o.deleteScheduled,
|
|
2016
|
-
preservePointerOnDelete: o.preservePointerOnDelete,
|
|
2017
|
-
ptr: o.ptr,
|
|
2018
|
-
ptrType: o.ptrType,
|
|
2019
|
-
smartPtr: o.smartPtr,
|
|
2020
|
-
smartPtrType: o.smartPtrType,
|
|
2021
|
-
};
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
function throwInstanceAlreadyDeleted(obj) {
|
|
2025
|
-
function getInstanceTypeName(handle) {
|
|
2026
|
-
return handle.$$.ptrType.registeredClass.name;
|
|
2027
|
-
}
|
|
2028
|
-
throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
var finalizationGroup=false;
|
|
2032
|
-
|
|
2033
|
-
function detachFinalizer(handle) {}
|
|
2034
|
-
|
|
2035
|
-
function runDestructor($$) {
|
|
2036
|
-
if ($$.smartPtr) {
|
|
2037
|
-
$$.smartPtrType.rawDestructor($$.smartPtr);
|
|
2038
|
-
} else {
|
|
2039
|
-
$$.ptrType.registeredClass.rawDestructor($$.ptr);
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
function releaseClassHandle($$) {
|
|
2043
|
-
$$.count.value -= 1;
|
|
2044
|
-
var toDelete = 0 === $$.count.value;
|
|
2045
|
-
if (toDelete) {
|
|
2046
|
-
runDestructor($$);
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
function attachFinalizer(handle) {
|
|
2050
|
-
if ('undefined' === typeof FinalizationGroup) {
|
|
2051
|
-
attachFinalizer = function (handle) { return handle; };
|
|
2052
|
-
return handle;
|
|
2053
|
-
}
|
|
2054
|
-
// If the running environment has a FinalizationGroup (see
|
|
2055
|
-
// https://github.com/tc39/proposal-weakrefs), then attach finalizers
|
|
2056
|
-
// for class handles. We check for the presence of FinalizationGroup
|
|
2057
|
-
// at run-time, not build-time.
|
|
2058
|
-
finalizationGroup = new FinalizationGroup(function (iter) {
|
|
2059
|
-
for (var result = iter.next(); !result.done; result = iter.next()) {
|
|
2060
|
-
var $$ = result.value;
|
|
2061
|
-
if (!$$.ptr) {
|
|
2062
|
-
console.warn('object already deleted: ' + $$.ptr);
|
|
2063
|
-
} else {
|
|
2064
|
-
releaseClassHandle($$);
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
});
|
|
2068
|
-
attachFinalizer = function(handle) {
|
|
2069
|
-
finalizationGroup.register(handle, handle.$$, handle.$$);
|
|
2070
|
-
return handle;
|
|
2071
|
-
};
|
|
2072
|
-
detachFinalizer = function(handle) {
|
|
2073
|
-
finalizationGroup.unregister(handle.$$);
|
|
2074
|
-
};
|
|
2075
|
-
return attachFinalizer(handle);
|
|
2076
|
-
}
|
|
2077
|
-
function ClassHandle_clone() {
|
|
2078
|
-
if (!this.$$.ptr) {
|
|
2079
|
-
throwInstanceAlreadyDeleted(this);
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
if (this.$$.preservePointerOnDelete) {
|
|
2083
|
-
this.$$.count.value += 1;
|
|
2084
|
-
return this;
|
|
2085
|
-
} else {
|
|
2086
|
-
var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), {
|
|
2087
|
-
$$: {
|
|
2088
|
-
value: shallowCopyInternalPointer(this.$$),
|
|
2089
|
-
}
|
|
2090
|
-
}));
|
|
2091
|
-
|
|
2092
|
-
clone.$$.count.value += 1;
|
|
2093
|
-
clone.$$.deleteScheduled = false;
|
|
2094
|
-
return clone;
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
function ClassHandle_delete() {
|
|
2099
|
-
if (!this.$$.ptr) {
|
|
2100
|
-
throwInstanceAlreadyDeleted(this);
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
|
|
2104
|
-
throwBindingError('Object already scheduled for deletion');
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
detachFinalizer(this);
|
|
2108
|
-
releaseClassHandle(this.$$);
|
|
2109
|
-
|
|
2110
|
-
if (!this.$$.preservePointerOnDelete) {
|
|
2111
|
-
this.$$.smartPtr = undefined;
|
|
2112
|
-
this.$$.ptr = undefined;
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
|
|
2116
|
-
function ClassHandle_isDeleted() {
|
|
2117
|
-
return !this.$$.ptr;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
var delayFunction=undefined;
|
|
2121
|
-
|
|
2122
|
-
var deletionQueue=[];
|
|
2123
|
-
|
|
2124
|
-
function flushPendingDeletes() {
|
|
2125
|
-
while (deletionQueue.length) {
|
|
2126
|
-
var obj = deletionQueue.pop();
|
|
2127
|
-
obj.$$.deleteScheduled = false;
|
|
2128
|
-
obj['delete']();
|
|
2129
|
-
}
|
|
2130
|
-
}
|
|
2131
|
-
function ClassHandle_deleteLater() {
|
|
2132
|
-
if (!this.$$.ptr) {
|
|
2133
|
-
throwInstanceAlreadyDeleted(this);
|
|
2134
|
-
}
|
|
2135
|
-
if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
|
|
2136
|
-
throwBindingError('Object already scheduled for deletion');
|
|
2137
|
-
}
|
|
2138
|
-
deletionQueue.push(this);
|
|
2139
|
-
if (deletionQueue.length === 1 && delayFunction) {
|
|
2140
|
-
delayFunction(flushPendingDeletes);
|
|
2141
|
-
}
|
|
2142
|
-
this.$$.deleteScheduled = true;
|
|
2143
|
-
return this;
|
|
2144
|
-
}
|
|
2145
|
-
function init_ClassHandle() {
|
|
2146
|
-
ClassHandle.prototype['isAliasOf'] = ClassHandle_isAliasOf;
|
|
2147
|
-
ClassHandle.prototype['clone'] = ClassHandle_clone;
|
|
2148
|
-
ClassHandle.prototype['delete'] = ClassHandle_delete;
|
|
2149
|
-
ClassHandle.prototype['isDeleted'] = ClassHandle_isDeleted;
|
|
2150
|
-
ClassHandle.prototype['deleteLater'] = ClassHandle_deleteLater;
|
|
2151
|
-
}
|
|
2152
|
-
function ClassHandle() {
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
var registeredPointers={};
|
|
2156
|
-
|
|
2157
|
-
function ensureOverloadTable(proto, methodName, humanName) {
|
|
2158
|
-
if (undefined === proto[methodName].overloadTable) {
|
|
2159
|
-
var prevFunc = proto[methodName];
|
|
2160
|
-
// Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
|
|
2161
|
-
proto[methodName] = function() {
|
|
2162
|
-
// TODO This check can be removed in -O3 level "unsafe" optimizations.
|
|
2163
|
-
if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) {
|
|
2164
|
-
throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + proto[methodName].overloadTable + ")!");
|
|
2165
|
-
}
|
|
2166
|
-
return proto[methodName].overloadTable[arguments.length].apply(this, arguments);
|
|
2167
|
-
};
|
|
2168
|
-
// Move the previous function into the overload table.
|
|
2169
|
-
proto[methodName].overloadTable = [];
|
|
2170
|
-
proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
/** @param {number=} numArguments */
|
|
2174
|
-
function exposePublicSymbol(name, value, numArguments) {
|
|
2175
|
-
if (Module.hasOwnProperty(name)) {
|
|
2176
|
-
if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) {
|
|
2177
|
-
throwBindingError("Cannot register public name '" + name + "' twice");
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
// We are exposing a function with the same name as an existing function. Create an overload table and a function selector
|
|
2181
|
-
// that routes between the two.
|
|
2182
|
-
ensureOverloadTable(Module, name, name);
|
|
2183
|
-
if (Module.hasOwnProperty(numArguments)) {
|
|
2184
|
-
throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!");
|
|
2185
|
-
}
|
|
2186
|
-
// Add the new function into the overload table.
|
|
2187
|
-
Module[name].overloadTable[numArguments] = value;
|
|
2188
|
-
}
|
|
2189
|
-
else {
|
|
2190
|
-
Module[name] = value;
|
|
2191
|
-
if (undefined !== numArguments) {
|
|
2192
|
-
Module[name].numArguments = numArguments;
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2197
|
-
/** @constructor */
|
|
2198
|
-
function RegisteredClass(
|
|
2199
|
-
name,
|
|
2200
|
-
constructor,
|
|
2201
|
-
instancePrototype,
|
|
2202
|
-
rawDestructor,
|
|
2203
|
-
baseClass,
|
|
2204
|
-
getActualType,
|
|
2205
|
-
upcast,
|
|
2206
|
-
downcast
|
|
2207
|
-
) {
|
|
2208
|
-
this.name = name;
|
|
2209
|
-
this.constructor = constructor;
|
|
2210
|
-
this.instancePrototype = instancePrototype;
|
|
2211
|
-
this.rawDestructor = rawDestructor;
|
|
2212
|
-
this.baseClass = baseClass;
|
|
2213
|
-
this.getActualType = getActualType;
|
|
2214
|
-
this.upcast = upcast;
|
|
2215
|
-
this.downcast = downcast;
|
|
2216
|
-
this.pureVirtualFunctions = [];
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
function upcastPointer(ptr, ptrClass, desiredClass) {
|
|
2220
|
-
while (ptrClass !== desiredClass) {
|
|
2221
|
-
if (!ptrClass.upcast) {
|
|
2222
|
-
throwBindingError("Expected null or instance of " + desiredClass.name + ", got an instance of " + ptrClass.name);
|
|
2223
|
-
}
|
|
2224
|
-
ptr = ptrClass.upcast(ptr);
|
|
2225
|
-
ptrClass = ptrClass.baseClass;
|
|
2226
|
-
}
|
|
2227
|
-
return ptr;
|
|
2228
|
-
}
|
|
2229
|
-
function constNoSmartPtrRawPointerToWireType(destructors, handle) {
|
|
2230
|
-
if (handle === null) {
|
|
2231
|
-
if (this.isReference) {
|
|
2232
|
-
throwBindingError('null is not a valid ' + this.name);
|
|
2233
|
-
}
|
|
2234
|
-
return 0;
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
if (!handle.$$) {
|
|
2238
|
-
throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name);
|
|
2239
|
-
}
|
|
2240
|
-
if (!handle.$$.ptr) {
|
|
2241
|
-
throwBindingError('Cannot pass deleted object as a pointer of type ' + this.name);
|
|
2242
|
-
}
|
|
2243
|
-
var handleClass = handle.$$.ptrType.registeredClass;
|
|
2244
|
-
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
2245
|
-
return ptr;
|
|
2246
|
-
}
|
|
2247
|
-
|
|
2248
|
-
function genericPointerToWireType(destructors, handle) {
|
|
2249
|
-
var ptr;
|
|
2250
|
-
if (handle === null) {
|
|
2251
|
-
if (this.isReference) {
|
|
2252
|
-
throwBindingError('null is not a valid ' + this.name);
|
|
2253
|
-
}
|
|
2254
|
-
|
|
2255
|
-
if (this.isSmartPointer) {
|
|
2256
|
-
ptr = this.rawConstructor();
|
|
2257
|
-
if (destructors !== null) {
|
|
2258
|
-
destructors.push(this.rawDestructor, ptr);
|
|
2259
|
-
}
|
|
2260
|
-
return ptr;
|
|
2261
|
-
} else {
|
|
2262
|
-
return 0;
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
if (!handle.$$) {
|
|
2267
|
-
throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name);
|
|
2268
|
-
}
|
|
2269
|
-
if (!handle.$$.ptr) {
|
|
2270
|
-
throwBindingError('Cannot pass deleted object as a pointer of type ' + this.name);
|
|
2271
|
-
}
|
|
2272
|
-
if (!this.isConst && handle.$$.ptrType.isConst) {
|
|
2273
|
-
throwBindingError('Cannot convert argument of type ' + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + ' to parameter type ' + this.name);
|
|
2274
|
-
}
|
|
2275
|
-
var handleClass = handle.$$.ptrType.registeredClass;
|
|
2276
|
-
ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
2277
|
-
|
|
2278
|
-
if (this.isSmartPointer) {
|
|
2279
|
-
// TODO: this is not strictly true
|
|
2280
|
-
// We could support BY_EMVAL conversions from raw pointers to smart pointers
|
|
2281
|
-
// because the smart pointer can hold a reference to the handle
|
|
2282
|
-
if (undefined === handle.$$.smartPtr) {
|
|
2283
|
-
throwBindingError('Passing raw pointer to smart pointer is illegal');
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
switch (this.sharingPolicy) {
|
|
2287
|
-
case 0: // NONE
|
|
2288
|
-
// no upcasting
|
|
2289
|
-
if (handle.$$.smartPtrType === this) {
|
|
2290
|
-
ptr = handle.$$.smartPtr;
|
|
2291
|
-
} else {
|
|
2292
|
-
throwBindingError('Cannot convert argument of type ' + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + ' to parameter type ' + this.name);
|
|
2293
|
-
}
|
|
2294
|
-
break;
|
|
2295
|
-
|
|
2296
|
-
case 1: // INTRUSIVE
|
|
2297
|
-
ptr = handle.$$.smartPtr;
|
|
2298
|
-
break;
|
|
2299
|
-
|
|
2300
|
-
case 2: // BY_EMVAL
|
|
2301
|
-
if (handle.$$.smartPtrType === this) {
|
|
2302
|
-
ptr = handle.$$.smartPtr;
|
|
2303
|
-
} else {
|
|
2304
|
-
var clonedHandle = handle['clone']();
|
|
2305
|
-
ptr = this.rawShare(
|
|
2306
|
-
ptr,
|
|
2307
|
-
__emval_register(function() {
|
|
2308
|
-
clonedHandle['delete']();
|
|
2309
|
-
})
|
|
2310
|
-
);
|
|
2311
|
-
if (destructors !== null) {
|
|
2312
|
-
destructors.push(this.rawDestructor, ptr);
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
break;
|
|
2316
|
-
|
|
2317
|
-
default:
|
|
2318
|
-
throwBindingError('Unsupporting sharing policy');
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
return ptr;
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) {
|
|
2325
|
-
if (handle === null) {
|
|
2326
|
-
if (this.isReference) {
|
|
2327
|
-
throwBindingError('null is not a valid ' + this.name);
|
|
2328
|
-
}
|
|
2329
|
-
return 0;
|
|
2330
|
-
}
|
|
2331
|
-
|
|
2332
|
-
if (!handle.$$) {
|
|
2333
|
-
throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name);
|
|
2334
|
-
}
|
|
2335
|
-
if (!handle.$$.ptr) {
|
|
2336
|
-
throwBindingError('Cannot pass deleted object as a pointer of type ' + this.name);
|
|
2337
|
-
}
|
|
2338
|
-
if (handle.$$.ptrType.isConst) {
|
|
2339
|
-
throwBindingError('Cannot convert argument of type ' + handle.$$.ptrType.name + ' to parameter type ' + this.name);
|
|
2340
|
-
}
|
|
2341
|
-
var handleClass = handle.$$.ptrType.registeredClass;
|
|
2342
|
-
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
2343
|
-
return ptr;
|
|
2344
|
-
}
|
|
2345
|
-
|
|
2346
|
-
function simpleReadValueFromPointer(pointer) {
|
|
2347
|
-
return this['fromWireType'](HEAPU32[pointer >> 2]);
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
function RegisteredPointer_getPointee(ptr) {
|
|
2351
|
-
if (this.rawGetPointee) {
|
|
2352
|
-
ptr = this.rawGetPointee(ptr);
|
|
2353
|
-
}
|
|
2354
|
-
return ptr;
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
function RegisteredPointer_destructor(ptr) {
|
|
2358
|
-
if (this.rawDestructor) {
|
|
2359
|
-
this.rawDestructor(ptr);
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
|
|
2363
|
-
function RegisteredPointer_deleteObject(handle) {
|
|
2364
|
-
if (handle !== null) {
|
|
2365
|
-
handle['delete']();
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
function downcastPointer(ptr, ptrClass, desiredClass) {
|
|
2370
|
-
if (ptrClass === desiredClass) {
|
|
2371
|
-
return ptr;
|
|
2372
|
-
}
|
|
2373
|
-
if (undefined === desiredClass.baseClass) {
|
|
2374
|
-
return null; // no conversion
|
|
2375
|
-
}
|
|
2376
|
-
|
|
2377
|
-
var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass);
|
|
2378
|
-
if (rv === null) {
|
|
2379
|
-
return null;
|
|
2380
|
-
}
|
|
2381
|
-
return desiredClass.downcast(rv);
|
|
2382
|
-
}
|
|
2383
|
-
|
|
2384
|
-
function getInheritedInstanceCount() {
|
|
2385
|
-
return Object.keys(registeredInstances).length;
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
function getLiveInheritedInstances() {
|
|
2389
|
-
var rv = [];
|
|
2390
|
-
for (var k in registeredInstances) {
|
|
2391
|
-
if (registeredInstances.hasOwnProperty(k)) {
|
|
2392
|
-
rv.push(registeredInstances[k]);
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
return rv;
|
|
2396
|
-
}
|
|
2397
|
-
|
|
2398
|
-
function setDelayFunction(fn) {
|
|
2399
|
-
delayFunction = fn;
|
|
2400
|
-
if (deletionQueue.length && delayFunction) {
|
|
2401
|
-
delayFunction(flushPendingDeletes);
|
|
2402
|
-
}
|
|
2403
|
-
}
|
|
2404
|
-
function init_embind() {
|
|
2405
|
-
Module['getInheritedInstanceCount'] = getInheritedInstanceCount;
|
|
2406
|
-
Module['getLiveInheritedInstances'] = getLiveInheritedInstances;
|
|
2407
|
-
Module['flushPendingDeletes'] = flushPendingDeletes;
|
|
2408
|
-
Module['setDelayFunction'] = setDelayFunction;
|
|
2409
|
-
}
|
|
2410
|
-
var registeredInstances={};
|
|
2411
|
-
|
|
2412
|
-
function getBasestPointer(class_, ptr) {
|
|
2413
|
-
if (ptr === undefined) {
|
|
2414
|
-
throwBindingError('ptr should not be undefined');
|
|
2415
|
-
}
|
|
2416
|
-
while (class_.baseClass) {
|
|
2417
|
-
ptr = class_.upcast(ptr);
|
|
2418
|
-
class_ = class_.baseClass;
|
|
2419
|
-
}
|
|
2420
|
-
return ptr;
|
|
2421
|
-
}
|
|
2422
|
-
function getInheritedInstance(class_, ptr) {
|
|
2423
|
-
ptr = getBasestPointer(class_, ptr);
|
|
2424
|
-
return registeredInstances[ptr];
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
function makeClassHandle(prototype, record) {
|
|
2428
|
-
if (!record.ptrType || !record.ptr) {
|
|
2429
|
-
throwInternalError('makeClassHandle requires ptr and ptrType');
|
|
2430
|
-
}
|
|
2431
|
-
var hasSmartPtrType = !!record.smartPtrType;
|
|
2432
|
-
var hasSmartPtr = !!record.smartPtr;
|
|
2433
|
-
if (hasSmartPtrType !== hasSmartPtr) {
|
|
2434
|
-
throwInternalError('Both smartPtrType and smartPtr must be specified');
|
|
2435
|
-
}
|
|
2436
|
-
record.count = { value: 1 };
|
|
2437
|
-
return attachFinalizer(Object.create(prototype, {
|
|
2438
|
-
$$: {
|
|
2439
|
-
value: record,
|
|
2440
|
-
},
|
|
2441
|
-
}));
|
|
2442
|
-
}
|
|
2443
|
-
function RegisteredPointer_fromWireType(ptr) {
|
|
2444
|
-
// ptr is a raw pointer (or a raw smartpointer)
|
|
2445
|
-
|
|
2446
|
-
// rawPointer is a maybe-null raw pointer
|
|
2447
|
-
var rawPointer = this.getPointee(ptr);
|
|
2448
|
-
if (!rawPointer) {
|
|
2449
|
-
this.destructor(ptr);
|
|
2450
|
-
return null;
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer);
|
|
2454
|
-
if (undefined !== registeredInstance) {
|
|
2455
|
-
// JS object has been neutered, time to repopulate it
|
|
2456
|
-
if (0 === registeredInstance.$$.count.value) {
|
|
2457
|
-
registeredInstance.$$.ptr = rawPointer;
|
|
2458
|
-
registeredInstance.$$.smartPtr = ptr;
|
|
2459
|
-
return registeredInstance['clone']();
|
|
2460
|
-
} else {
|
|
2461
|
-
// else, just increment reference count on existing object
|
|
2462
|
-
// it already has a reference to the smart pointer
|
|
2463
|
-
var rv = registeredInstance['clone']();
|
|
2464
|
-
this.destructor(ptr);
|
|
2465
|
-
return rv;
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
|
|
2469
|
-
function makeDefaultHandle() {
|
|
2470
|
-
if (this.isSmartPointer) {
|
|
2471
|
-
return makeClassHandle(this.registeredClass.instancePrototype, {
|
|
2472
|
-
ptrType: this.pointeeType,
|
|
2473
|
-
ptr: rawPointer,
|
|
2474
|
-
smartPtrType: this,
|
|
2475
|
-
smartPtr: ptr,
|
|
2476
|
-
});
|
|
2477
|
-
} else {
|
|
2478
|
-
return makeClassHandle(this.registeredClass.instancePrototype, {
|
|
2479
|
-
ptrType: this,
|
|
2480
|
-
ptr: ptr,
|
|
2481
|
-
});
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
|
|
2485
|
-
var actualType = this.registeredClass.getActualType(rawPointer);
|
|
2486
|
-
var registeredPointerRecord = registeredPointers[actualType];
|
|
2487
|
-
if (!registeredPointerRecord) {
|
|
2488
|
-
return makeDefaultHandle.call(this);
|
|
2489
|
-
}
|
|
2490
|
-
|
|
2491
|
-
var toType;
|
|
2492
|
-
if (this.isConst) {
|
|
2493
|
-
toType = registeredPointerRecord.constPointerType;
|
|
2494
|
-
} else {
|
|
2495
|
-
toType = registeredPointerRecord.pointerType;
|
|
2496
|
-
}
|
|
2497
|
-
var dp = downcastPointer(
|
|
2498
|
-
rawPointer,
|
|
2499
|
-
this.registeredClass,
|
|
2500
|
-
toType.registeredClass);
|
|
2501
|
-
if (dp === null) {
|
|
2502
|
-
return makeDefaultHandle.call(this);
|
|
2503
|
-
}
|
|
2504
|
-
if (this.isSmartPointer) {
|
|
2505
|
-
return makeClassHandle(toType.registeredClass.instancePrototype, {
|
|
2506
|
-
ptrType: toType,
|
|
2507
|
-
ptr: dp,
|
|
2508
|
-
smartPtrType: this,
|
|
2509
|
-
smartPtr: ptr,
|
|
2510
|
-
});
|
|
2511
|
-
} else {
|
|
2512
|
-
return makeClassHandle(toType.registeredClass.instancePrototype, {
|
|
2513
|
-
ptrType: toType,
|
|
2514
|
-
ptr: dp,
|
|
2515
|
-
});
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
function init_RegisteredPointer() {
|
|
2519
|
-
RegisteredPointer.prototype.getPointee = RegisteredPointer_getPointee;
|
|
2520
|
-
RegisteredPointer.prototype.destructor = RegisteredPointer_destructor;
|
|
2521
|
-
RegisteredPointer.prototype['argPackAdvance'] = 8;
|
|
2522
|
-
RegisteredPointer.prototype['readValueFromPointer'] = simpleReadValueFromPointer;
|
|
2523
|
-
RegisteredPointer.prototype['deleteObject'] = RegisteredPointer_deleteObject;
|
|
2524
|
-
RegisteredPointer.prototype['fromWireType'] = RegisteredPointer_fromWireType;
|
|
2525
|
-
}
|
|
2526
|
-
/** @constructor
|
|
2527
|
-
@param {*=} pointeeType,
|
|
2528
|
-
@param {*=} sharingPolicy,
|
|
2529
|
-
@param {*=} rawGetPointee,
|
|
2530
|
-
@param {*=} rawConstructor,
|
|
2531
|
-
@param {*=} rawShare,
|
|
2532
|
-
@param {*=} rawDestructor,
|
|
2533
|
-
*/
|
|
2534
|
-
function RegisteredPointer(
|
|
2535
|
-
name,
|
|
2536
|
-
registeredClass,
|
|
2537
|
-
isReference,
|
|
2538
|
-
isConst,
|
|
2539
|
-
|
|
2540
|
-
// smart pointer properties
|
|
2541
|
-
isSmartPointer,
|
|
2542
|
-
pointeeType,
|
|
2543
|
-
sharingPolicy,
|
|
2544
|
-
rawGetPointee,
|
|
2545
|
-
rawConstructor,
|
|
2546
|
-
rawShare,
|
|
2547
|
-
rawDestructor
|
|
2548
|
-
) {
|
|
2549
|
-
this.name = name;
|
|
2550
|
-
this.registeredClass = registeredClass;
|
|
2551
|
-
this.isReference = isReference;
|
|
2552
|
-
this.isConst = isConst;
|
|
2553
|
-
|
|
2554
|
-
// smart pointer properties
|
|
2555
|
-
this.isSmartPointer = isSmartPointer;
|
|
2556
|
-
this.pointeeType = pointeeType;
|
|
2557
|
-
this.sharingPolicy = sharingPolicy;
|
|
2558
|
-
this.rawGetPointee = rawGetPointee;
|
|
2559
|
-
this.rawConstructor = rawConstructor;
|
|
2560
|
-
this.rawShare = rawShare;
|
|
2561
|
-
this.rawDestructor = rawDestructor;
|
|
2562
|
-
|
|
2563
|
-
if (!isSmartPointer && registeredClass.baseClass === undefined) {
|
|
2564
|
-
if (isConst) {
|
|
2565
|
-
this['toWireType'] = constNoSmartPtrRawPointerToWireType;
|
|
2566
|
-
this.destructorFunction = null;
|
|
2567
|
-
} else {
|
|
2568
|
-
this['toWireType'] = nonConstNoSmartPtrRawPointerToWireType;
|
|
2569
|
-
this.destructorFunction = null;
|
|
2570
|
-
}
|
|
2571
|
-
} else {
|
|
2572
|
-
this['toWireType'] = genericPointerToWireType;
|
|
2573
|
-
// Here we must leave this.destructorFunction undefined, since whether genericPointerToWireType returns
|
|
2574
|
-
// a pointer that needs to be freed up is runtime-dependent, and cannot be evaluated at registration time.
|
|
2575
|
-
// TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in
|
|
2576
|
-
// craftInvokerFunction altogether.
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
|
|
2580
|
-
/** @param {number=} numArguments */
|
|
2581
|
-
function replacePublicSymbol(name, value, numArguments) {
|
|
2582
|
-
if (!Module.hasOwnProperty(name)) {
|
|
2583
|
-
throwInternalError('Replacing nonexistant public symbol');
|
|
2584
|
-
}
|
|
2585
|
-
// If there's an overload table for this symbol, replace the symbol in the overload table instead.
|
|
2586
|
-
if (undefined !== Module[name].overloadTable && undefined !== numArguments) {
|
|
2587
|
-
Module[name].overloadTable[numArguments] = value;
|
|
2588
|
-
}
|
|
2589
|
-
else {
|
|
2590
|
-
Module[name] = value;
|
|
2591
|
-
Module[name].argCount = numArguments;
|
|
2592
|
-
}
|
|
2593
|
-
}
|
|
2594
|
-
|
|
2595
|
-
function getDynCaller(sig, ptr) {
|
|
2596
|
-
assert(sig.indexOf('j') >= 0, 'getDynCaller should only be called with i64 sigs')
|
|
2597
|
-
var argCache = [];
|
|
2598
|
-
return function() {
|
|
2599
|
-
argCache.length = arguments.length;
|
|
2600
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
2601
|
-
argCache[i] = arguments[i];
|
|
2602
|
-
}
|
|
2603
|
-
return dynCall(sig, ptr, argCache);
|
|
2604
|
-
};
|
|
2605
|
-
}
|
|
2606
|
-
function embind__requireFunction(signature, rawFunction) {
|
|
2607
|
-
signature = readLatin1String(signature);
|
|
2608
|
-
|
|
2609
|
-
function makeDynCaller() {
|
|
2610
|
-
if (signature.indexOf('j') != -1) {
|
|
2611
|
-
return getDynCaller(signature, rawFunction);
|
|
2612
|
-
}
|
|
2613
|
-
return wasmTable.get(rawFunction);
|
|
2614
|
-
}
|
|
2615
|
-
|
|
2616
|
-
var fp = makeDynCaller();
|
|
2617
|
-
if (typeof fp !== "function") {
|
|
2618
|
-
throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction);
|
|
2619
|
-
}
|
|
2620
|
-
return fp;
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
var UnboundTypeError=undefined;
|
|
2624
|
-
|
|
2625
|
-
function getTypeName(type) {
|
|
2626
|
-
var ptr = ___getTypeName(type);
|
|
2627
|
-
var rv = readLatin1String(ptr);
|
|
2628
|
-
_free(ptr);
|
|
2629
|
-
return rv;
|
|
2630
|
-
}
|
|
2631
|
-
function throwUnboundTypeError(message, types) {
|
|
2632
|
-
var unboundTypes = [];
|
|
2633
|
-
var seen = {};
|
|
2634
|
-
function visit(type) {
|
|
2635
|
-
if (seen[type]) {
|
|
2636
|
-
return;
|
|
2637
|
-
}
|
|
2638
|
-
if (registeredTypes[type]) {
|
|
2639
|
-
return;
|
|
2640
|
-
}
|
|
2641
|
-
if (typeDependencies[type]) {
|
|
2642
|
-
typeDependencies[type].forEach(visit);
|
|
2643
|
-
return;
|
|
2644
|
-
}
|
|
2645
|
-
unboundTypes.push(type);
|
|
2646
|
-
seen[type] = true;
|
|
2647
|
-
}
|
|
2648
|
-
types.forEach(visit);
|
|
2649
|
-
|
|
2650
|
-
throw new UnboundTypeError(message + ': ' + unboundTypes.map(getTypeName).join([', ']));
|
|
2651
|
-
}
|
|
2652
|
-
function __embind_register_class(
|
|
2653
|
-
rawType,
|
|
2654
|
-
rawPointerType,
|
|
2655
|
-
rawConstPointerType,
|
|
2656
|
-
baseClassRawType,
|
|
2657
|
-
getActualTypeSignature,
|
|
2658
|
-
getActualType,
|
|
2659
|
-
upcastSignature,
|
|
2660
|
-
upcast,
|
|
2661
|
-
downcastSignature,
|
|
2662
|
-
downcast,
|
|
2663
|
-
name,
|
|
2664
|
-
destructorSignature,
|
|
2665
|
-
rawDestructor
|
|
2666
|
-
) {
|
|
2667
|
-
name = readLatin1String(name);
|
|
2668
|
-
getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
|
|
2669
|
-
if (upcast) {
|
|
2670
|
-
upcast = embind__requireFunction(upcastSignature, upcast);
|
|
2671
|
-
}
|
|
2672
|
-
if (downcast) {
|
|
2673
|
-
downcast = embind__requireFunction(downcastSignature, downcast);
|
|
2674
|
-
}
|
|
2675
|
-
rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
|
|
2676
|
-
var legalFunctionName = makeLegalFunctionName(name);
|
|
2677
|
-
|
|
2678
|
-
exposePublicSymbol(legalFunctionName, function() {
|
|
2679
|
-
// this code cannot run if baseClassRawType is zero
|
|
2680
|
-
throwUnboundTypeError('Cannot construct ' + name + ' due to unbound types', [baseClassRawType]);
|
|
2681
|
-
});
|
|
2682
|
-
|
|
2683
|
-
whenDependentTypesAreResolved(
|
|
2684
|
-
[rawType, rawPointerType, rawConstPointerType],
|
|
2685
|
-
baseClassRawType ? [baseClassRawType] : [],
|
|
2686
|
-
function(base) {
|
|
2687
|
-
base = base[0];
|
|
2688
|
-
|
|
2689
|
-
var baseClass;
|
|
2690
|
-
var basePrototype;
|
|
2691
|
-
if (baseClassRawType) {
|
|
2692
|
-
baseClass = base.registeredClass;
|
|
2693
|
-
basePrototype = baseClass.instancePrototype;
|
|
2694
|
-
} else {
|
|
2695
|
-
basePrototype = ClassHandle.prototype;
|
|
2696
|
-
}
|
|
2697
|
-
|
|
2698
|
-
var constructor = createNamedFunction(legalFunctionName, function() {
|
|
2699
|
-
if (Object.getPrototypeOf(this) !== instancePrototype) {
|
|
2700
|
-
throw new BindingError("Use 'new' to construct " + name);
|
|
2701
|
-
}
|
|
2702
|
-
if (undefined === registeredClass.constructor_body) {
|
|
2703
|
-
throw new BindingError(name + " has no accessible constructor");
|
|
2704
|
-
}
|
|
2705
|
-
var body = registeredClass.constructor_body[arguments.length];
|
|
2706
|
-
if (undefined === body) {
|
|
2707
|
-
throw new BindingError("Tried to invoke ctor of " + name + " with invalid number of parameters (" + arguments.length + ") - expected (" + Object.keys(registeredClass.constructor_body).toString() + ") parameters instead!");
|
|
2708
|
-
}
|
|
2709
|
-
return body.apply(this, arguments);
|
|
2710
|
-
});
|
|
2711
|
-
|
|
2712
|
-
var instancePrototype = Object.create(basePrototype, {
|
|
2713
|
-
constructor: { value: constructor },
|
|
2714
|
-
});
|
|
2715
|
-
|
|
2716
|
-
constructor.prototype = instancePrototype;
|
|
2717
|
-
|
|
2718
|
-
var registeredClass = new RegisteredClass(
|
|
2719
|
-
name,
|
|
2720
|
-
constructor,
|
|
2721
|
-
instancePrototype,
|
|
2722
|
-
rawDestructor,
|
|
2723
|
-
baseClass,
|
|
2724
|
-
getActualType,
|
|
2725
|
-
upcast,
|
|
2726
|
-
downcast);
|
|
2727
|
-
|
|
2728
|
-
var referenceConverter = new RegisteredPointer(
|
|
2729
|
-
name,
|
|
2730
|
-
registeredClass,
|
|
2731
|
-
true,
|
|
2732
|
-
false,
|
|
2733
|
-
false);
|
|
2734
|
-
|
|
2735
|
-
var pointerConverter = new RegisteredPointer(
|
|
2736
|
-
name + '*',
|
|
2737
|
-
registeredClass,
|
|
2738
|
-
false,
|
|
2739
|
-
false,
|
|
2740
|
-
false);
|
|
2741
|
-
|
|
2742
|
-
var constPointerConverter = new RegisteredPointer(
|
|
2743
|
-
name + ' const*',
|
|
2744
|
-
registeredClass,
|
|
2745
|
-
false,
|
|
2746
|
-
true,
|
|
2747
|
-
false);
|
|
2748
|
-
|
|
2749
|
-
registeredPointers[rawType] = {
|
|
2750
|
-
pointerType: pointerConverter,
|
|
2751
|
-
constPointerType: constPointerConverter
|
|
2752
|
-
};
|
|
2753
|
-
|
|
2754
|
-
replacePublicSymbol(legalFunctionName, constructor);
|
|
2755
|
-
|
|
2756
|
-
return [referenceConverter, pointerConverter, constPointerConverter];
|
|
2757
|
-
}
|
|
2758
|
-
);
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
function heap32VectorToArray(count, firstElement) {
|
|
2762
|
-
var array = [];
|
|
2763
|
-
for (var i = 0; i < count; i++) {
|
|
2764
|
-
array.push(HEAP32[(firstElement >> 2) + i]);
|
|
2765
|
-
}
|
|
2766
|
-
return array;
|
|
2767
|
-
}
|
|
2768
|
-
|
|
2769
|
-
function runDestructors(destructors) {
|
|
2770
|
-
while (destructors.length) {
|
|
2771
|
-
var ptr = destructors.pop();
|
|
2772
|
-
var del = destructors.pop();
|
|
2773
|
-
del(ptr);
|
|
2774
|
-
}
|
|
2775
|
-
}
|
|
2776
|
-
function __embind_register_class_constructor(
|
|
2777
|
-
rawClassType,
|
|
2778
|
-
argCount,
|
|
2779
|
-
rawArgTypesAddr,
|
|
2780
|
-
invokerSignature,
|
|
2781
|
-
invoker,
|
|
2782
|
-
rawConstructor
|
|
2783
|
-
) {
|
|
2784
|
-
assert(argCount > 0);
|
|
2785
|
-
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
2786
|
-
invoker = embind__requireFunction(invokerSignature, invoker);
|
|
2787
|
-
var args = [rawConstructor];
|
|
2788
|
-
var destructors = [];
|
|
2789
|
-
|
|
2790
|
-
whenDependentTypesAreResolved([], [rawClassType], function(classType) {
|
|
2791
|
-
classType = classType[0];
|
|
2792
|
-
var humanName = 'constructor ' + classType.name;
|
|
2793
|
-
|
|
2794
|
-
if (undefined === classType.registeredClass.constructor_body) {
|
|
2795
|
-
classType.registeredClass.constructor_body = [];
|
|
2796
|
-
}
|
|
2797
|
-
if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {
|
|
2798
|
-
throw new BindingError("Cannot register multiple constructors with identical number of parameters (" + (argCount-1) + ") for class '" + classType.name + "'! Overload resolution is currently only performed using the parameter count, not actual type info!");
|
|
2799
|
-
}
|
|
2800
|
-
classType.registeredClass.constructor_body[argCount - 1] = function unboundTypeHandler() {
|
|
2801
|
-
throwUnboundTypeError('Cannot construct ' + classType.name + ' due to unbound types', rawArgTypes);
|
|
2802
|
-
};
|
|
2803
|
-
|
|
2804
|
-
whenDependentTypesAreResolved([], rawArgTypes, function(argTypes) {
|
|
2805
|
-
classType.registeredClass.constructor_body[argCount - 1] = function constructor_body() {
|
|
2806
|
-
if (arguments.length !== argCount - 1) {
|
|
2807
|
-
throwBindingError(humanName + ' called with ' + arguments.length + ' arguments, expected ' + (argCount-1));
|
|
2808
|
-
}
|
|
2809
|
-
destructors.length = 0;
|
|
2810
|
-
args.length = argCount;
|
|
2811
|
-
for (var i = 1; i < argCount; ++i) {
|
|
2812
|
-
args[i] = argTypes[i]['toWireType'](destructors, arguments[i - 1]);
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
var ptr = invoker.apply(null, args);
|
|
2816
|
-
runDestructors(destructors);
|
|
2817
|
-
|
|
2818
|
-
return argTypes[0]['fromWireType'](ptr);
|
|
2819
|
-
};
|
|
2820
|
-
return [];
|
|
2821
|
-
});
|
|
2822
|
-
return [];
|
|
2823
|
-
});
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
function new_(constructor, argumentList) {
|
|
2827
|
-
if (!(constructor instanceof Function)) {
|
|
2828
|
-
throw new TypeError('new_ called with constructor type ' + typeof(constructor) + " which is not a function");
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
|
-
/*
|
|
2832
|
-
* Previously, the following line was just:
|
|
2833
|
-
|
|
2834
|
-
function dummy() {};
|
|
2835
|
-
|
|
2836
|
-
* Unfortunately, Chrome was preserving 'dummy' as the object's name, even though at creation, the 'dummy' has the
|
|
2837
|
-
* correct constructor name. Thus, objects created with IMVU.new would show up in the debugger as 'dummy', which
|
|
2838
|
-
* isn't very helpful. Using IMVU.createNamedFunction addresses the issue. Doublely-unfortunately, there's no way
|
|
2839
|
-
* to write a test for this behavior. -NRD 2013.02.22
|
|
2840
|
-
*/
|
|
2841
|
-
var dummy = createNamedFunction(constructor.name || 'unknownFunctionName', function(){});
|
|
2842
|
-
dummy.prototype = constructor.prototype;
|
|
2843
|
-
var obj = new dummy;
|
|
2844
|
-
|
|
2845
|
-
var r = constructor.apply(obj, argumentList);
|
|
2846
|
-
return (r instanceof Object) ? r : obj;
|
|
2847
|
-
}
|
|
2848
|
-
function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) {
|
|
2849
|
-
// humanName: a human-readable string name for the function to be generated.
|
|
2850
|
-
// argTypes: An array that contains the embind type objects for all types in the function signature.
|
|
2851
|
-
// argTypes[0] is the type object for the function return value.
|
|
2852
|
-
// argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method.
|
|
2853
|
-
// argTypes[2...] are the actual function parameters.
|
|
2854
|
-
// classType: The embind type object for the class to be bound, or null if this is not a method of a class.
|
|
2855
|
-
// cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code.
|
|
2856
|
-
// cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling.
|
|
2857
|
-
var argCount = argTypes.length;
|
|
2858
|
-
|
|
2859
|
-
if (argCount < 2) {
|
|
2860
|
-
throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
var isClassMethodFunc = (argTypes[1] !== null && classType !== null);
|
|
2864
|
-
|
|
2865
|
-
// Free functions with signature "void function()" do not need an invoker that marshalls between wire types.
|
|
2866
|
-
// TODO: This omits argument count check - enable only at -O3 or similar.
|
|
2867
|
-
// if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) {
|
|
2868
|
-
// return FUNCTION_TABLE[fn];
|
|
2869
|
-
// }
|
|
2870
|
-
|
|
2871
|
-
// Determine if we need to use a dynamic stack to store the destructors for the function parameters.
|
|
2872
|
-
// TODO: Remove this completely once all function invokers are being dynamically generated.
|
|
2873
|
-
var needsDestructorStack = false;
|
|
2874
|
-
|
|
2875
|
-
for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here.
|
|
2876
|
-
if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack
|
|
2877
|
-
needsDestructorStack = true;
|
|
2878
|
-
break;
|
|
2879
|
-
}
|
|
2880
|
-
}
|
|
2881
|
-
|
|
2882
|
-
var returns = (argTypes[0].name !== "void");
|
|
2883
|
-
|
|
2884
|
-
var argsList = "";
|
|
2885
|
-
var argsListWired = "";
|
|
2886
|
-
for(var i = 0; i < argCount - 2; ++i) {
|
|
2887
|
-
argsList += (i!==0?", ":"")+"arg"+i;
|
|
2888
|
-
argsListWired += (i!==0?", ":"")+"arg"+i+"Wired";
|
|
2889
|
-
}
|
|
2890
|
-
|
|
2891
|
-
var invokerFnBody =
|
|
2892
|
-
"return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n" +
|
|
2893
|
-
"if (arguments.length !== "+(argCount - 2)+") {\n" +
|
|
2894
|
-
"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount - 2)+" args!');\n" +
|
|
2895
|
-
"}\n";
|
|
2896
|
-
|
|
2897
|
-
if (needsDestructorStack) {
|
|
2898
|
-
invokerFnBody +=
|
|
2899
|
-
"var destructors = [];\n";
|
|
2900
|
-
}
|
|
2901
|
-
|
|
2902
|
-
var dtorStack = needsDestructorStack ? "destructors" : "null";
|
|
2903
|
-
var args1 = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"];
|
|
2904
|
-
var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]];
|
|
2905
|
-
|
|
2906
|
-
if (isClassMethodFunc) {
|
|
2907
|
-
invokerFnBody += "var thisWired = classParam.toWireType("+dtorStack+", this);\n";
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
for(var i = 0; i < argCount - 2; ++i) {
|
|
2911
|
-
invokerFnBody += "var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";
|
|
2912
|
-
args1.push("argType"+i);
|
|
2913
|
-
args2.push(argTypes[i+2]);
|
|
2914
|
-
}
|
|
2915
|
-
|
|
2916
|
-
if (isClassMethodFunc) {
|
|
2917
|
-
argsListWired = "thisWired" + (argsListWired.length > 0 ? ", " : "") + argsListWired;
|
|
2918
|
-
}
|
|
2919
|
-
|
|
2920
|
-
invokerFnBody +=
|
|
2921
|
-
(returns?"var rv = ":"") + "invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";
|
|
2922
|
-
|
|
2923
|
-
if (needsDestructorStack) {
|
|
2924
|
-
invokerFnBody += "runDestructors(destructors);\n";
|
|
2925
|
-
} else {
|
|
2926
|
-
for(var i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
|
|
2927
|
-
var paramName = (i === 1 ? "thisWired" : ("arg"+(i - 2)+"Wired"));
|
|
2928
|
-
if (argTypes[i].destructorFunction !== null) {
|
|
2929
|
-
invokerFnBody += paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";
|
|
2930
|
-
args1.push(paramName+"_dtor");
|
|
2931
|
-
args2.push(argTypes[i].destructorFunction);
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
}
|
|
2935
|
-
|
|
2936
|
-
if (returns) {
|
|
2937
|
-
invokerFnBody += "var ret = retType.fromWireType(rv);\n" +
|
|
2938
|
-
"return ret;\n";
|
|
2939
|
-
} else {
|
|
2940
|
-
}
|
|
2941
|
-
invokerFnBody += "}\n";
|
|
2942
|
-
|
|
2943
|
-
args1.push(invokerFnBody);
|
|
2944
|
-
|
|
2945
|
-
var invokerFunction = new_(Function, args1).apply(null, args2);
|
|
2946
|
-
return invokerFunction;
|
|
2947
|
-
}
|
|
2948
|
-
function __embind_register_class_function(
|
|
2949
|
-
rawClassType,
|
|
2950
|
-
methodName,
|
|
2951
|
-
argCount,
|
|
2952
|
-
rawArgTypesAddr, // [ReturnType, ThisType, Args...]
|
|
2953
|
-
invokerSignature,
|
|
2954
|
-
rawInvoker,
|
|
2955
|
-
context,
|
|
2956
|
-
isPureVirtual
|
|
2957
|
-
) {
|
|
2958
|
-
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
2959
|
-
methodName = readLatin1String(methodName);
|
|
2960
|
-
rawInvoker = embind__requireFunction(invokerSignature, rawInvoker);
|
|
2961
|
-
|
|
2962
|
-
whenDependentTypesAreResolved([], [rawClassType], function(classType) {
|
|
2963
|
-
classType = classType[0];
|
|
2964
|
-
var humanName = classType.name + '.' + methodName;
|
|
2965
|
-
|
|
2966
|
-
if (isPureVirtual) {
|
|
2967
|
-
classType.registeredClass.pureVirtualFunctions.push(methodName);
|
|
2968
|
-
}
|
|
2969
|
-
|
|
2970
|
-
function unboundTypesHandler() {
|
|
2971
|
-
throwUnboundTypeError('Cannot call ' + humanName + ' due to unbound types', rawArgTypes);
|
|
2972
|
-
}
|
|
2973
|
-
|
|
2974
|
-
var proto = classType.registeredClass.instancePrototype;
|
|
2975
|
-
var method = proto[methodName];
|
|
2976
|
-
if (undefined === method || (undefined === method.overloadTable && method.className !== classType.name && method.argCount === argCount - 2)) {
|
|
2977
|
-
// This is the first overload to be registered, OR we are replacing a function in the base class with a function in the derived class.
|
|
2978
|
-
unboundTypesHandler.argCount = argCount - 2;
|
|
2979
|
-
unboundTypesHandler.className = classType.name;
|
|
2980
|
-
proto[methodName] = unboundTypesHandler;
|
|
2981
|
-
} else {
|
|
2982
|
-
// There was an existing function with the same name registered. Set up a function overload routing table.
|
|
2983
|
-
ensureOverloadTable(proto, methodName, humanName);
|
|
2984
|
-
proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler;
|
|
2985
|
-
}
|
|
2986
|
-
|
|
2987
|
-
whenDependentTypesAreResolved([], rawArgTypes, function(argTypes) {
|
|
2988
|
-
|
|
2989
|
-
var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context);
|
|
2990
|
-
|
|
2991
|
-
// Replace the initial unbound-handler-stub function with the appropriate member function, now that all types
|
|
2992
|
-
// are resolved. If multiple overloads are registered for this function, the function goes into an overload table.
|
|
2993
|
-
if (undefined === proto[methodName].overloadTable) {
|
|
2994
|
-
// Set argCount in case an overload is registered later
|
|
2995
|
-
memberFunction.argCount = argCount - 2;
|
|
2996
|
-
proto[methodName] = memberFunction;
|
|
2997
|
-
} else {
|
|
2998
|
-
proto[methodName].overloadTable[argCount - 2] = memberFunction;
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
return [];
|
|
3002
|
-
});
|
|
3003
|
-
return [];
|
|
3004
|
-
});
|
|
3005
|
-
}
|
|
3006
|
-
|
|
3007
|
-
var emval_free_list=[];
|
|
3008
|
-
|
|
3009
|
-
var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];
|
|
3010
|
-
function __emval_decref(handle) {
|
|
3011
|
-
if (handle > 4 && 0 === --emval_handle_array[handle].refcount) {
|
|
3012
|
-
emval_handle_array[handle] = undefined;
|
|
3013
|
-
emval_free_list.push(handle);
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
3016
|
-
|
|
3017
|
-
function count_emval_handles() {
|
|
3018
|
-
var count = 0;
|
|
3019
|
-
for (var i = 5; i < emval_handle_array.length; ++i) {
|
|
3020
|
-
if (emval_handle_array[i] !== undefined) {
|
|
3021
|
-
++count;
|
|
3022
|
-
}
|
|
3023
|
-
}
|
|
3024
|
-
return count;
|
|
3025
|
-
}
|
|
3026
|
-
|
|
3027
|
-
function get_first_emval() {
|
|
3028
|
-
for (var i = 5; i < emval_handle_array.length; ++i) {
|
|
3029
|
-
if (emval_handle_array[i] !== undefined) {
|
|
3030
|
-
return emval_handle_array[i];
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
return null;
|
|
3034
|
-
}
|
|
3035
|
-
function init_emval() {
|
|
3036
|
-
Module['count_emval_handles'] = count_emval_handles;
|
|
3037
|
-
Module['get_first_emval'] = get_first_emval;
|
|
3038
|
-
}
|
|
3039
|
-
function __emval_register(value) {
|
|
3040
|
-
|
|
3041
|
-
switch(value){
|
|
3042
|
-
case undefined :{ return 1; }
|
|
3043
|
-
case null :{ return 2; }
|
|
3044
|
-
case true :{ return 3; }
|
|
3045
|
-
case false :{ return 4; }
|
|
3046
|
-
default:{
|
|
3047
|
-
var handle = emval_free_list.length ?
|
|
3048
|
-
emval_free_list.pop() :
|
|
3049
|
-
emval_handle_array.length;
|
|
3050
|
-
|
|
3051
|
-
emval_handle_array[handle] = {refcount: 1, value: value};
|
|
3052
|
-
return handle;
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
}
|
|
3056
|
-
function __embind_register_emval(rawType, name) {
|
|
3057
|
-
name = readLatin1String(name);
|
|
3058
|
-
registerType(rawType, {
|
|
3059
|
-
name: name,
|
|
3060
|
-
'fromWireType': function(handle) {
|
|
3061
|
-
var rv = emval_handle_array[handle].value;
|
|
3062
|
-
__emval_decref(handle);
|
|
3063
|
-
return rv;
|
|
3064
|
-
},
|
|
3065
|
-
'toWireType': function(destructors, value) {
|
|
3066
|
-
return __emval_register(value);
|
|
3067
|
-
},
|
|
3068
|
-
'argPackAdvance': 8,
|
|
3069
|
-
'readValueFromPointer': simpleReadValueFromPointer,
|
|
3070
|
-
destructorFunction: null, // This type does not need a destructor
|
|
3071
|
-
|
|
3072
|
-
// TODO: do we need a deleteObject here? write a test where
|
|
3073
|
-
// emval is passed into JS via an interface
|
|
3074
|
-
});
|
|
3075
|
-
}
|
|
3076
|
-
|
|
3077
|
-
function _embind_repr(v) {
|
|
3078
|
-
if (v === null) {
|
|
3079
|
-
return 'null';
|
|
3080
|
-
}
|
|
3081
|
-
var t = typeof v;
|
|
3082
|
-
if (t === 'object' || t === 'array' || t === 'function') {
|
|
3083
|
-
return v.toString();
|
|
3084
|
-
} else {
|
|
3085
|
-
return '' + v;
|
|
3086
|
-
}
|
|
3087
|
-
}
|
|
3088
|
-
|
|
3089
|
-
function floatReadValueFromPointer(name, shift) {
|
|
3090
|
-
switch (shift) {
|
|
3091
|
-
case 2: return function(pointer) {
|
|
3092
|
-
return this['fromWireType'](HEAPF32[pointer >> 2]);
|
|
3093
|
-
};
|
|
3094
|
-
case 3: return function(pointer) {
|
|
3095
|
-
return this['fromWireType'](HEAPF64[pointer >> 3]);
|
|
3096
|
-
};
|
|
3097
|
-
default:
|
|
3098
|
-
throw new TypeError("Unknown float type: " + name);
|
|
3099
|
-
}
|
|
3100
|
-
}
|
|
3101
|
-
function __embind_register_float(rawType, name, size) {
|
|
3102
|
-
var shift = getShiftFromSize(size);
|
|
3103
|
-
name = readLatin1String(name);
|
|
3104
|
-
registerType(rawType, {
|
|
3105
|
-
name: name,
|
|
3106
|
-
'fromWireType': function(value) {
|
|
3107
|
-
return value;
|
|
3108
|
-
},
|
|
3109
|
-
'toWireType': function(destructors, value) {
|
|
3110
|
-
// todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could
|
|
3111
|
-
// avoid the following if() and assume value is of proper type.
|
|
3112
|
-
if (typeof value !== "number" && typeof value !== "boolean") {
|
|
3113
|
-
throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name);
|
|
3114
|
-
}
|
|
3115
|
-
return value;
|
|
3116
|
-
},
|
|
3117
|
-
'argPackAdvance': 8,
|
|
3118
|
-
'readValueFromPointer': floatReadValueFromPointer(name, shift),
|
|
3119
|
-
destructorFunction: null, // This type does not need a destructor
|
|
3120
|
-
});
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
function integerReadValueFromPointer(name, shift, signed) {
|
|
3124
|
-
// integers are quite common, so generate very specialized functions
|
|
3125
|
-
switch (shift) {
|
|
3126
|
-
case 0: return signed ?
|
|
3127
|
-
function readS8FromPointer(pointer) { return HEAP8[pointer]; } :
|
|
3128
|
-
function readU8FromPointer(pointer) { return HEAPU8[pointer]; };
|
|
3129
|
-
case 1: return signed ?
|
|
3130
|
-
function readS16FromPointer(pointer) { return HEAP16[pointer >> 1]; } :
|
|
3131
|
-
function readU16FromPointer(pointer) { return HEAPU16[pointer >> 1]; };
|
|
3132
|
-
case 2: return signed ?
|
|
3133
|
-
function readS32FromPointer(pointer) { return HEAP32[pointer >> 2]; } :
|
|
3134
|
-
function readU32FromPointer(pointer) { return HEAPU32[pointer >> 2]; };
|
|
3135
|
-
default:
|
|
3136
|
-
throw new TypeError("Unknown integer type: " + name);
|
|
3137
|
-
}
|
|
3138
|
-
}
|
|
3139
|
-
function __embind_register_integer(primitiveType, name, size, minRange, maxRange) {
|
|
3140
|
-
name = readLatin1String(name);
|
|
3141
|
-
if (maxRange === -1) { // LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come out as 'i32 -1'. Always treat those as max u32.
|
|
3142
|
-
maxRange = 4294967295;
|
|
3143
|
-
}
|
|
3144
|
-
|
|
3145
|
-
var shift = getShiftFromSize(size);
|
|
3146
|
-
|
|
3147
|
-
var fromWireType = function(value) {
|
|
3148
|
-
return value;
|
|
3149
|
-
};
|
|
3150
|
-
|
|
3151
|
-
if (minRange === 0) {
|
|
3152
|
-
var bitshift = 32 - 8*size;
|
|
3153
|
-
fromWireType = function(value) {
|
|
3154
|
-
return (value << bitshift) >>> bitshift;
|
|
3155
|
-
};
|
|
3156
|
-
}
|
|
3157
|
-
|
|
3158
|
-
var isUnsignedType = (name.indexOf('unsigned') != -1);
|
|
3159
|
-
|
|
3160
|
-
registerType(primitiveType, {
|
|
3161
|
-
name: name,
|
|
3162
|
-
'fromWireType': fromWireType,
|
|
3163
|
-
'toWireType': function(destructors, value) {
|
|
3164
|
-
// todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could
|
|
3165
|
-
// avoid the following two if()s and assume value is of proper type.
|
|
3166
|
-
if (typeof value !== "number" && typeof value !== "boolean") {
|
|
3167
|
-
throw new TypeError('Cannot convert "' + _embind_repr(value) + '" to ' + this.name);
|
|
3168
|
-
}
|
|
3169
|
-
if (value < minRange || value > maxRange) {
|
|
3170
|
-
throw new TypeError('Passing a number "' + _embind_repr(value) + '" from JS side to C/C++ side to an argument of type "' + name + '", which is outside the valid range [' + minRange + ', ' + maxRange + ']!');
|
|
3171
|
-
}
|
|
3172
|
-
return isUnsignedType ? (value >>> 0) : (value | 0);
|
|
3173
|
-
},
|
|
3174
|
-
'argPackAdvance': 8,
|
|
3175
|
-
'readValueFromPointer': integerReadValueFromPointer(name, shift, minRange !== 0),
|
|
3176
|
-
destructorFunction: null, // This type does not need a destructor
|
|
3177
|
-
});
|
|
3178
|
-
}
|
|
3179
|
-
|
|
3180
|
-
function __embind_register_memory_view(rawType, dataTypeIndex, name) {
|
|
3181
|
-
var typeMapping = [
|
|
3182
|
-
Int8Array,
|
|
3183
|
-
Uint8Array,
|
|
3184
|
-
Int16Array,
|
|
3185
|
-
Uint16Array,
|
|
3186
|
-
Int32Array,
|
|
3187
|
-
Uint32Array,
|
|
3188
|
-
Float32Array,
|
|
3189
|
-
Float64Array,
|
|
3190
|
-
];
|
|
3191
|
-
|
|
3192
|
-
var TA = typeMapping[dataTypeIndex];
|
|
3193
|
-
|
|
3194
|
-
function decodeMemoryView(handle) {
|
|
3195
|
-
handle = handle >> 2;
|
|
3196
|
-
var heap = HEAPU32;
|
|
3197
|
-
var size = heap[handle]; // in elements
|
|
3198
|
-
var data = heap[handle + 1]; // byte offset into emscripten heap
|
|
3199
|
-
return new TA(buffer, data, size);
|
|
3200
|
-
}
|
|
3201
|
-
|
|
3202
|
-
name = readLatin1String(name);
|
|
3203
|
-
registerType(rawType, {
|
|
3204
|
-
name: name,
|
|
3205
|
-
'fromWireType': decodeMemoryView,
|
|
3206
|
-
'argPackAdvance': 8,
|
|
3207
|
-
'readValueFromPointer': decodeMemoryView,
|
|
3208
|
-
}, {
|
|
3209
|
-
ignoreDuplicateRegistrations: true,
|
|
3210
|
-
});
|
|
3211
|
-
}
|
|
3212
|
-
|
|
3213
|
-
function __embind_register_smart_ptr(
|
|
3214
|
-
rawType,
|
|
3215
|
-
rawPointeeType,
|
|
3216
|
-
name,
|
|
3217
|
-
sharingPolicy,
|
|
3218
|
-
getPointeeSignature,
|
|
3219
|
-
rawGetPointee,
|
|
3220
|
-
constructorSignature,
|
|
3221
|
-
rawConstructor,
|
|
3222
|
-
shareSignature,
|
|
3223
|
-
rawShare,
|
|
3224
|
-
destructorSignature,
|
|
3225
|
-
rawDestructor
|
|
3226
|
-
) {
|
|
3227
|
-
name = readLatin1String(name);
|
|
3228
|
-
rawGetPointee = embind__requireFunction(getPointeeSignature, rawGetPointee);
|
|
3229
|
-
rawConstructor = embind__requireFunction(constructorSignature, rawConstructor);
|
|
3230
|
-
rawShare = embind__requireFunction(shareSignature, rawShare);
|
|
3231
|
-
rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
|
|
3232
|
-
|
|
3233
|
-
whenDependentTypesAreResolved([rawType], [rawPointeeType], function(pointeeType) {
|
|
3234
|
-
pointeeType = pointeeType[0];
|
|
3235
|
-
|
|
3236
|
-
var registeredPointer = new RegisteredPointer(
|
|
3237
|
-
name,
|
|
3238
|
-
pointeeType.registeredClass,
|
|
3239
|
-
false,
|
|
3240
|
-
false,
|
|
3241
|
-
// smart pointer properties
|
|
3242
|
-
true,
|
|
3243
|
-
pointeeType,
|
|
3244
|
-
sharingPolicy,
|
|
3245
|
-
rawGetPointee,
|
|
3246
|
-
rawConstructor,
|
|
3247
|
-
rawShare,
|
|
3248
|
-
rawDestructor);
|
|
3249
|
-
return [registeredPointer];
|
|
3250
|
-
});
|
|
3251
|
-
}
|
|
3252
|
-
|
|
3253
|
-
function __embind_register_std_string(rawType, name) {
|
|
3254
|
-
name = readLatin1String(name);
|
|
3255
|
-
var stdStringIsUTF8
|
|
3256
|
-
//process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string<unsigned char>
|
|
3257
|
-
= (name === "std::string");
|
|
3258
|
-
|
|
3259
|
-
registerType(rawType, {
|
|
3260
|
-
name: name,
|
|
3261
|
-
'fromWireType': function(value) {
|
|
3262
|
-
var length = HEAPU32[value >> 2];
|
|
3263
|
-
|
|
3264
|
-
var str;
|
|
3265
|
-
if (stdStringIsUTF8) {
|
|
3266
|
-
var decodeStartPtr = value + 4;
|
|
3267
|
-
// Looping here to support possible embedded '0' bytes
|
|
3268
|
-
for (var i = 0; i <= length; ++i) {
|
|
3269
|
-
var currentBytePtr = value + 4 + i;
|
|
3270
|
-
if (i == length || HEAPU8[currentBytePtr] == 0) {
|
|
3271
|
-
var maxRead = currentBytePtr - decodeStartPtr;
|
|
3272
|
-
var stringSegment = UTF8ToString(decodeStartPtr, maxRead);
|
|
3273
|
-
if (str === undefined) {
|
|
3274
|
-
str = stringSegment;
|
|
3275
|
-
} else {
|
|
3276
|
-
str += String.fromCharCode(0);
|
|
3277
|
-
str += stringSegment;
|
|
3278
|
-
}
|
|
3279
|
-
decodeStartPtr = currentBytePtr + 1;
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
} else {
|
|
3283
|
-
var a = new Array(length);
|
|
3284
|
-
for (var i = 0; i < length; ++i) {
|
|
3285
|
-
a[i] = String.fromCharCode(HEAPU8[value + 4 + i]);
|
|
3286
|
-
}
|
|
3287
|
-
str = a.join('');
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
_free(value);
|
|
3291
|
-
|
|
3292
|
-
return str;
|
|
3293
|
-
},
|
|
3294
|
-
'toWireType': function(destructors, value) {
|
|
3295
|
-
if (value instanceof ArrayBuffer) {
|
|
3296
|
-
value = new Uint8Array(value);
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
var getLength;
|
|
3300
|
-
var valueIsOfTypeString = (typeof value === 'string');
|
|
3301
|
-
|
|
3302
|
-
if (!(valueIsOfTypeString || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array)) {
|
|
3303
|
-
throwBindingError('Cannot pass non-string to std::string');
|
|
3304
|
-
}
|
|
3305
|
-
if (stdStringIsUTF8 && valueIsOfTypeString) {
|
|
3306
|
-
getLength = function() {return lengthBytesUTF8(value);};
|
|
3307
|
-
} else {
|
|
3308
|
-
getLength = function() {return value.length;};
|
|
3309
|
-
}
|
|
3310
|
-
|
|
3311
|
-
// assumes 4-byte alignment
|
|
3312
|
-
var length = getLength();
|
|
3313
|
-
var ptr = _malloc(4 + length + 1);
|
|
3314
|
-
HEAPU32[ptr >> 2] = length;
|
|
3315
|
-
if (stdStringIsUTF8 && valueIsOfTypeString) {
|
|
3316
|
-
stringToUTF8(value, ptr + 4, length + 1);
|
|
3317
|
-
} else {
|
|
3318
|
-
if (valueIsOfTypeString) {
|
|
3319
|
-
for (var i = 0; i < length; ++i) {
|
|
3320
|
-
var charCode = value.charCodeAt(i);
|
|
3321
|
-
if (charCode > 255) {
|
|
3322
|
-
_free(ptr);
|
|
3323
|
-
throwBindingError('String has UTF-16 code units that do not fit in 8 bits');
|
|
3324
|
-
}
|
|
3325
|
-
HEAPU8[ptr + 4 + i] = charCode;
|
|
3326
|
-
}
|
|
3327
|
-
} else {
|
|
3328
|
-
for (var i = 0; i < length; ++i) {
|
|
3329
|
-
HEAPU8[ptr + 4 + i] = value[i];
|
|
3330
|
-
}
|
|
3331
|
-
}
|
|
3332
|
-
}
|
|
3333
|
-
|
|
3334
|
-
if (destructors !== null) {
|
|
3335
|
-
destructors.push(_free, ptr);
|
|
3336
|
-
}
|
|
3337
|
-
return ptr;
|
|
3338
|
-
},
|
|
3339
|
-
'argPackAdvance': 8,
|
|
3340
|
-
'readValueFromPointer': simpleReadValueFromPointer,
|
|
3341
|
-
destructorFunction: function(ptr) { _free(ptr); },
|
|
3342
|
-
});
|
|
3343
|
-
}
|
|
3344
|
-
|
|
3345
|
-
function __embind_register_std_wstring(rawType, charSize, name) {
|
|
3346
|
-
name = readLatin1String(name);
|
|
3347
|
-
var decodeString, encodeString, getHeap, lengthBytesUTF, shift;
|
|
3348
|
-
if (charSize === 2) {
|
|
3349
|
-
decodeString = UTF16ToString;
|
|
3350
|
-
encodeString = stringToUTF16;
|
|
3351
|
-
lengthBytesUTF = lengthBytesUTF16;
|
|
3352
|
-
getHeap = function() { return HEAPU16; };
|
|
3353
|
-
shift = 1;
|
|
3354
|
-
} else if (charSize === 4) {
|
|
3355
|
-
decodeString = UTF32ToString;
|
|
3356
|
-
encodeString = stringToUTF32;
|
|
3357
|
-
lengthBytesUTF = lengthBytesUTF32;
|
|
3358
|
-
getHeap = function() { return HEAPU32; };
|
|
3359
|
-
shift = 2;
|
|
3360
|
-
}
|
|
3361
|
-
registerType(rawType, {
|
|
3362
|
-
name: name,
|
|
3363
|
-
'fromWireType': function(value) {
|
|
3364
|
-
// Code mostly taken from _embind_register_std_string fromWireType
|
|
3365
|
-
var length = HEAPU32[value >> 2];
|
|
3366
|
-
var HEAP = getHeap();
|
|
3367
|
-
var str;
|
|
3368
|
-
|
|
3369
|
-
var decodeStartPtr = value + 4;
|
|
3370
|
-
// Looping here to support possible embedded '0' bytes
|
|
3371
|
-
for (var i = 0; i <= length; ++i) {
|
|
3372
|
-
var currentBytePtr = value + 4 + i * charSize;
|
|
3373
|
-
if (i == length || HEAP[currentBytePtr >> shift] == 0) {
|
|
3374
|
-
var maxReadBytes = currentBytePtr - decodeStartPtr;
|
|
3375
|
-
var stringSegment = decodeString(decodeStartPtr, maxReadBytes);
|
|
3376
|
-
if (str === undefined) {
|
|
3377
|
-
str = stringSegment;
|
|
3378
|
-
} else {
|
|
3379
|
-
str += String.fromCharCode(0);
|
|
3380
|
-
str += stringSegment;
|
|
3381
|
-
}
|
|
3382
|
-
decodeStartPtr = currentBytePtr + charSize;
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
|
|
3386
|
-
_free(value);
|
|
3387
|
-
|
|
3388
|
-
return str;
|
|
3389
|
-
},
|
|
3390
|
-
'toWireType': function(destructors, value) {
|
|
3391
|
-
if (!(typeof value === 'string')) {
|
|
3392
|
-
throwBindingError('Cannot pass non-string to C++ string type ' + name);
|
|
3393
|
-
}
|
|
3394
|
-
|
|
3395
|
-
// assumes 4-byte alignment
|
|
3396
|
-
var length = lengthBytesUTF(value);
|
|
3397
|
-
var ptr = _malloc(4 + length + charSize);
|
|
3398
|
-
HEAPU32[ptr >> 2] = length >> shift;
|
|
3399
|
-
|
|
3400
|
-
encodeString(value, ptr + 4, length + charSize);
|
|
3401
|
-
|
|
3402
|
-
if (destructors !== null) {
|
|
3403
|
-
destructors.push(_free, ptr);
|
|
3404
|
-
}
|
|
3405
|
-
return ptr;
|
|
3406
|
-
},
|
|
3407
|
-
'argPackAdvance': 8,
|
|
3408
|
-
'readValueFromPointer': simpleReadValueFromPointer,
|
|
3409
|
-
destructorFunction: function(ptr) { _free(ptr); },
|
|
3410
|
-
});
|
|
3411
|
-
}
|
|
3412
|
-
|
|
3413
|
-
function __embind_register_void(rawType, name) {
|
|
3414
|
-
name = readLatin1String(name);
|
|
3415
|
-
registerType(rawType, {
|
|
3416
|
-
isVoid: true, // void return values can be optimized out sometimes
|
|
3417
|
-
name: name,
|
|
3418
|
-
'argPackAdvance': 0,
|
|
3419
|
-
'fromWireType': function() {
|
|
3420
|
-
return undefined;
|
|
3421
|
-
},
|
|
3422
|
-
'toWireType': function(destructors, o) {
|
|
3423
|
-
// TODO: assert if anything else is given?
|
|
3424
|
-
return undefined;
|
|
3425
|
-
},
|
|
3426
|
-
});
|
|
3427
|
-
}
|
|
3428
|
-
|
|
3429
|
-
function requireRegisteredType(rawType, humanName) {
|
|
3430
|
-
var impl = registeredTypes[rawType];
|
|
3431
|
-
if (undefined === impl) {
|
|
3432
|
-
throwBindingError(humanName + " has unknown type " + getTypeName(rawType));
|
|
3433
|
-
}
|
|
3434
|
-
return impl;
|
|
3435
|
-
}
|
|
3436
|
-
function __emval_lookupTypes(argCount, argTypes) {
|
|
3437
|
-
var a = new Array(argCount);
|
|
3438
|
-
for (var i = 0; i < argCount; ++i) {
|
|
3439
|
-
a[i] = requireRegisteredType(
|
|
3440
|
-
HEAP32[(argTypes >> 2) + i],
|
|
3441
|
-
"parameter " + i);
|
|
3442
|
-
}
|
|
3443
|
-
return a;
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3446
|
-
function requireHandle(handle) {
|
|
3447
|
-
if (!handle) {
|
|
3448
|
-
throwBindingError('Cannot use deleted val. handle = ' + handle);
|
|
3449
|
-
}
|
|
3450
|
-
return emval_handle_array[handle].value;
|
|
3451
|
-
}
|
|
3452
|
-
function __emval_call(handle, argCount, argTypes, argv) {
|
|
3453
|
-
handle = requireHandle(handle);
|
|
3454
|
-
var types = __emval_lookupTypes(argCount, argTypes);
|
|
3455
|
-
|
|
3456
|
-
var args = new Array(argCount);
|
|
3457
|
-
for (var i = 0; i < argCount; ++i) {
|
|
3458
|
-
var type = types[i];
|
|
3459
|
-
args[i] = type['readValueFromPointer'](argv);
|
|
3460
|
-
argv += type['argPackAdvance'];
|
|
3461
|
-
}
|
|
3462
|
-
|
|
3463
|
-
var rv = handle.apply(undefined, args);
|
|
3464
|
-
return __emval_register(rv);
|
|
3465
|
-
}
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
function __emval_incref(handle) {
|
|
3469
|
-
if (handle > 4) {
|
|
3470
|
-
emval_handle_array[handle].refcount += 1;
|
|
3471
|
-
}
|
|
3472
|
-
}
|
|
3473
|
-
|
|
3474
|
-
function __emval_new_array() {
|
|
3475
|
-
return __emval_register([]);
|
|
3476
|
-
}
|
|
3477
|
-
|
|
3478
|
-
var emval_symbols={};
|
|
3479
|
-
function getStringOrSymbol(address) {
|
|
3480
|
-
var symbol = emval_symbols[address];
|
|
3481
|
-
if (symbol === undefined) {
|
|
3482
|
-
return readLatin1String(address);
|
|
3483
|
-
} else {
|
|
3484
|
-
return symbol;
|
|
3485
|
-
}
|
|
3486
|
-
}
|
|
3487
|
-
function __emval_new_cstring(v) {
|
|
3488
|
-
return __emval_register(getStringOrSymbol(v));
|
|
3489
|
-
}
|
|
3490
|
-
|
|
3491
|
-
function __emval_new_object() {
|
|
3492
|
-
return __emval_register({});
|
|
3493
|
-
}
|
|
3494
|
-
|
|
3495
|
-
function __emval_set_property(handle, key, value) {
|
|
3496
|
-
handle = requireHandle(handle);
|
|
3497
|
-
key = requireHandle(key);
|
|
3498
|
-
value = requireHandle(value);
|
|
3499
|
-
handle[key] = value;
|
|
3500
|
-
}
|
|
3501
|
-
|
|
3502
|
-
function __emval_take_value(type, argv) {
|
|
3503
|
-
type = requireRegisteredType(type, '_emval_take_value');
|
|
3504
|
-
var v = type['readValueFromPointer'](argv);
|
|
3505
|
-
return __emval_register(v);
|
|
3506
|
-
}
|
|
3507
|
-
|
|
3508
|
-
function _abort() {
|
|
3509
|
-
abort();
|
|
3510
|
-
}
|
|
3511
|
-
|
|
3512
|
-
function _emscripten_memcpy_big(dest, src, num) {
|
|
3513
|
-
HEAPU8.copyWithin(dest, src, src + num);
|
|
3514
|
-
}
|
|
3515
|
-
|
|
3516
|
-
function _emscripten_get_heap_size() {
|
|
3517
|
-
return HEAPU8.length;
|
|
3518
|
-
}
|
|
3519
|
-
|
|
3520
|
-
function abortOnCannotGrowMemory(requestedSize) {
|
|
3521
|
-
abort('Cannot enlarge memory arrays to size ' + requestedSize + ' bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value ' + HEAP8.length + ', (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ');
|
|
3522
|
-
}
|
|
3523
|
-
function _emscripten_resize_heap(requestedSize) {
|
|
3524
|
-
requestedSize = requestedSize >>> 0;
|
|
3525
|
-
abortOnCannotGrowMemory(requestedSize);
|
|
3526
|
-
}
|
|
3527
|
-
|
|
3528
|
-
var ENV={};
|
|
3529
|
-
|
|
3530
|
-
function getExecutableName() {
|
|
3531
|
-
return thisProgram || './this.program';
|
|
3532
|
-
}
|
|
3533
|
-
function getEnvStrings() {
|
|
3534
|
-
if (!getEnvStrings.strings) {
|
|
3535
|
-
// Default values.
|
|
3536
|
-
// Browser language detection #8751
|
|
3537
|
-
var lang = ((typeof navigator === 'object' && navigator.languages && navigator.languages[0]) || 'C').replace('-', '_') + '.UTF-8';
|
|
3538
|
-
var env = {
|
|
3539
|
-
'USER': 'web_user',
|
|
3540
|
-
'LOGNAME': 'web_user',
|
|
3541
|
-
'PATH': '/',
|
|
3542
|
-
'PWD': '/',
|
|
3543
|
-
'HOME': '/home/web_user',
|
|
3544
|
-
'LANG': lang,
|
|
3545
|
-
'_': getExecutableName()
|
|
3546
|
-
};
|
|
3547
|
-
// Apply the user-provided values, if any.
|
|
3548
|
-
for (var x in ENV) {
|
|
3549
|
-
env[x] = ENV[x];
|
|
3550
|
-
}
|
|
3551
|
-
var strings = [];
|
|
3552
|
-
for (var x in env) {
|
|
3553
|
-
strings.push(x + '=' + env[x]);
|
|
3554
|
-
}
|
|
3555
|
-
getEnvStrings.strings = strings;
|
|
3556
|
-
}
|
|
3557
|
-
return getEnvStrings.strings;
|
|
3558
|
-
}
|
|
3559
|
-
|
|
3560
|
-
var SYSCALLS={mappings:{},buffers:[null,[],[]],printChar:function(stream, curr) {
|
|
3561
|
-
var buffer = SYSCALLS.buffers[stream];
|
|
3562
|
-
assert(buffer);
|
|
3563
|
-
if (curr === 0 || curr === 10) {
|
|
3564
|
-
(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
|
|
3565
|
-
buffer.length = 0;
|
|
3566
|
-
} else {
|
|
3567
|
-
buffer.push(curr);
|
|
3568
|
-
}
|
|
3569
|
-
},varargs:undefined,get:function() {
|
|
3570
|
-
assert(SYSCALLS.varargs != undefined);
|
|
3571
|
-
SYSCALLS.varargs += 4;
|
|
3572
|
-
var ret = HEAP32[(((SYSCALLS.varargs)-(4))>>2)];
|
|
3573
|
-
return ret;
|
|
3574
|
-
},getStr:function(ptr) {
|
|
3575
|
-
var ret = UTF8ToString(ptr);
|
|
3576
|
-
return ret;
|
|
3577
|
-
},get64:function(low, high) {
|
|
3578
|
-
if (low >= 0) assert(high === 0);
|
|
3579
|
-
else assert(high === -1);
|
|
3580
|
-
return low;
|
|
3581
|
-
}};
|
|
3582
|
-
function _environ_get(__environ, environ_buf) {
|
|
3583
|
-
var bufSize = 0;
|
|
3584
|
-
getEnvStrings().forEach(function(string, i) {
|
|
3585
|
-
var ptr = environ_buf + bufSize;
|
|
3586
|
-
HEAP32[(((__environ)+(i * 4))>>2)]=ptr;
|
|
3587
|
-
writeAsciiToMemory(string, ptr);
|
|
3588
|
-
bufSize += string.length + 1;
|
|
3589
|
-
});
|
|
3590
|
-
return 0;
|
|
3591
|
-
}
|
|
3592
|
-
|
|
3593
|
-
function _environ_sizes_get(penviron_count, penviron_buf_size) {
|
|
3594
|
-
var strings = getEnvStrings();
|
|
3595
|
-
HEAP32[((penviron_count)>>2)]=strings.length;
|
|
3596
|
-
var bufSize = 0;
|
|
3597
|
-
strings.forEach(function(string) {
|
|
3598
|
-
bufSize += string.length + 1;
|
|
3599
|
-
});
|
|
3600
|
-
HEAP32[((penviron_buf_size)>>2)]=bufSize;
|
|
3601
|
-
return 0;
|
|
3602
|
-
}
|
|
3603
|
-
|
|
3604
|
-
function _fd_close(fd) {
|
|
3605
|
-
abort('it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM');
|
|
3606
|
-
return 0;
|
|
3607
|
-
}
|
|
3608
|
-
|
|
3609
|
-
function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
|
|
3610
|
-
abort('it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM');
|
|
3611
|
-
}
|
|
3612
|
-
|
|
3613
|
-
function flush_NO_FILESYSTEM() {
|
|
3614
|
-
// flush anything remaining in the buffers during shutdown
|
|
3615
|
-
if (typeof _fflush !== 'undefined') _fflush(0);
|
|
3616
|
-
var buffers = SYSCALLS.buffers;
|
|
3617
|
-
if (buffers[1].length) SYSCALLS.printChar(1, 10);
|
|
3618
|
-
if (buffers[2].length) SYSCALLS.printChar(2, 10);
|
|
3619
|
-
}
|
|
3620
|
-
function _fd_write(fd, iov, iovcnt, pnum) {
|
|
3621
|
-
// hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
|
|
3622
|
-
var num = 0;
|
|
3623
|
-
for (var i = 0; i < iovcnt; i++) {
|
|
3624
|
-
var ptr = HEAP32[(((iov)+(i*8))>>2)];
|
|
3625
|
-
var len = HEAP32[(((iov)+(i*8 + 4))>>2)];
|
|
3626
|
-
for (var j = 0; j < len; j++) {
|
|
3627
|
-
SYSCALLS.printChar(fd, HEAPU8[ptr+j]);
|
|
3628
|
-
}
|
|
3629
|
-
num += len;
|
|
3630
|
-
}
|
|
3631
|
-
HEAP32[((pnum)>>2)]=num
|
|
3632
|
-
return 0;
|
|
3633
|
-
}
|
|
3634
|
-
|
|
3635
|
-
function _pthread_rwlock_destroy() { return 0; }
|
|
3636
|
-
|
|
3637
|
-
function _pthread_rwlock_init() { return 0; }
|
|
3638
|
-
|
|
3639
|
-
function _pthread_rwlock_rdlock() { return 0; }
|
|
3640
|
-
|
|
3641
|
-
function _pthread_rwlock_unlock() { return 0; }
|
|
3642
|
-
|
|
3643
|
-
function _pthread_rwlock_wrlock() { return 0; }
|
|
3644
|
-
|
|
3645
|
-
function _setTempRet0($i) {
|
|
3646
|
-
setTempRet0(($i) | 0);
|
|
3647
|
-
}
|
|
3648
|
-
|
|
3649
|
-
function __isLeapYear(year) {
|
|
3650
|
-
return year%4 === 0 && (year%100 !== 0 || year%400 === 0);
|
|
3651
|
-
}
|
|
3652
|
-
|
|
3653
|
-
function __arraySum(array, index) {
|
|
3654
|
-
var sum = 0;
|
|
3655
|
-
for (var i = 0; i <= index; sum += array[i++]) {
|
|
3656
|
-
// no-op
|
|
3657
|
-
}
|
|
3658
|
-
return sum;
|
|
3659
|
-
}
|
|
3660
|
-
|
|
3661
|
-
var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];
|
|
3662
|
-
|
|
3663
|
-
var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];
|
|
3664
|
-
function __addDays(date, days) {
|
|
3665
|
-
var newDate = new Date(date.getTime());
|
|
3666
|
-
while(days > 0) {
|
|
3667
|
-
var leap = __isLeapYear(newDate.getFullYear());
|
|
3668
|
-
var currentMonth = newDate.getMonth();
|
|
3669
|
-
var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth];
|
|
3670
|
-
|
|
3671
|
-
if (days > daysInCurrentMonth-newDate.getDate()) {
|
|
3672
|
-
// we spill over to next month
|
|
3673
|
-
days -= (daysInCurrentMonth-newDate.getDate()+1);
|
|
3674
|
-
newDate.setDate(1);
|
|
3675
|
-
if (currentMonth < 11) {
|
|
3676
|
-
newDate.setMonth(currentMonth+1)
|
|
3677
|
-
} else {
|
|
3678
|
-
newDate.setMonth(0);
|
|
3679
|
-
newDate.setFullYear(newDate.getFullYear()+1);
|
|
3680
|
-
}
|
|
3681
|
-
} else {
|
|
3682
|
-
// we stay in current month
|
|
3683
|
-
newDate.setDate(newDate.getDate()+days);
|
|
3684
|
-
return newDate;
|
|
3685
|
-
}
|
|
3686
|
-
}
|
|
3687
|
-
|
|
3688
|
-
return newDate;
|
|
3689
|
-
}
|
|
3690
|
-
function _strftime(s, maxsize, format, tm) {
|
|
3691
|
-
// size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);
|
|
3692
|
-
// http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
|
|
3693
|
-
|
|
3694
|
-
var tm_zone = HEAP32[(((tm)+(40))>>2)];
|
|
3695
|
-
|
|
3696
|
-
var date = {
|
|
3697
|
-
tm_sec: HEAP32[((tm)>>2)],
|
|
3698
|
-
tm_min: HEAP32[(((tm)+(4))>>2)],
|
|
3699
|
-
tm_hour: HEAP32[(((tm)+(8))>>2)],
|
|
3700
|
-
tm_mday: HEAP32[(((tm)+(12))>>2)],
|
|
3701
|
-
tm_mon: HEAP32[(((tm)+(16))>>2)],
|
|
3702
|
-
tm_year: HEAP32[(((tm)+(20))>>2)],
|
|
3703
|
-
tm_wday: HEAP32[(((tm)+(24))>>2)],
|
|
3704
|
-
tm_yday: HEAP32[(((tm)+(28))>>2)],
|
|
3705
|
-
tm_isdst: HEAP32[(((tm)+(32))>>2)],
|
|
3706
|
-
tm_gmtoff: HEAP32[(((tm)+(36))>>2)],
|
|
3707
|
-
tm_zone: tm_zone ? UTF8ToString(tm_zone) : ''
|
|
3708
|
-
};
|
|
3709
|
-
|
|
3710
|
-
var pattern = UTF8ToString(format);
|
|
3711
|
-
|
|
3712
|
-
// expand format
|
|
3713
|
-
var EXPANSION_RULES_1 = {
|
|
3714
|
-
'%c': '%a %b %d %H:%M:%S %Y', // Replaced by the locale's appropriate date and time representation - e.g., Mon Aug 3 14:02:01 2013
|
|
3715
|
-
'%D': '%m/%d/%y', // Equivalent to %m / %d / %y
|
|
3716
|
-
'%F': '%Y-%m-%d', // Equivalent to %Y - %m - %d
|
|
3717
|
-
'%h': '%b', // Equivalent to %b
|
|
3718
|
-
'%r': '%I:%M:%S %p', // Replaced by the time in a.m. and p.m. notation
|
|
3719
|
-
'%R': '%H:%M', // Replaced by the time in 24-hour notation
|
|
3720
|
-
'%T': '%H:%M:%S', // Replaced by the time
|
|
3721
|
-
'%x': '%m/%d/%y', // Replaced by the locale's appropriate date representation
|
|
3722
|
-
'%X': '%H:%M:%S', // Replaced by the locale's appropriate time representation
|
|
3723
|
-
// Modified Conversion Specifiers
|
|
3724
|
-
'%Ec': '%c', // Replaced by the locale's alternative appropriate date and time representation.
|
|
3725
|
-
'%EC': '%C', // Replaced by the name of the base year (period) in the locale's alternative representation.
|
|
3726
|
-
'%Ex': '%m/%d/%y', // Replaced by the locale's alternative date representation.
|
|
3727
|
-
'%EX': '%H:%M:%S', // Replaced by the locale's alternative time representation.
|
|
3728
|
-
'%Ey': '%y', // Replaced by the offset from %EC (year only) in the locale's alternative representation.
|
|
3729
|
-
'%EY': '%Y', // Replaced by the full alternative year representation.
|
|
3730
|
-
'%Od': '%d', // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading <space> characters.
|
|
3731
|
-
'%Oe': '%e', // Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading <space> characters.
|
|
3732
|
-
'%OH': '%H', // Replaced by the hour (24-hour clock) using the locale's alternative numeric symbols.
|
|
3733
|
-
'%OI': '%I', // Replaced by the hour (12-hour clock) using the locale's alternative numeric symbols.
|
|
3734
|
-
'%Om': '%m', // Replaced by the month using the locale's alternative numeric symbols.
|
|
3735
|
-
'%OM': '%M', // Replaced by the minutes using the locale's alternative numeric symbols.
|
|
3736
|
-
'%OS': '%S', // Replaced by the seconds using the locale's alternative numeric symbols.
|
|
3737
|
-
'%Ou': '%u', // Replaced by the weekday as a number in the locale's alternative representation (Monday=1).
|
|
3738
|
-
'%OU': '%U', // Replaced by the week number of the year (Sunday as the first day of the week, rules corresponding to %U ) using the locale's alternative numeric symbols.
|
|
3739
|
-
'%OV': '%V', // Replaced by the week number of the year (Monday as the first day of the week, rules corresponding to %V ) using the locale's alternative numeric symbols.
|
|
3740
|
-
'%Ow': '%w', // Replaced by the number of the weekday (Sunday=0) using the locale's alternative numeric symbols.
|
|
3741
|
-
'%OW': '%W', // Replaced by the week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols.
|
|
3742
|
-
'%Oy': '%y', // Replaced by the year (offset from %C ) using the locale's alternative numeric symbols.
|
|
3743
|
-
};
|
|
3744
|
-
for (var rule in EXPANSION_RULES_1) {
|
|
3745
|
-
pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_1[rule]);
|
|
3746
|
-
}
|
|
3747
|
-
|
|
3748
|
-
var WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
3749
|
-
var MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
3750
|
-
|
|
3751
|
-
function leadingSomething(value, digits, character) {
|
|
3752
|
-
var str = typeof value === 'number' ? value.toString() : (value || '');
|
|
3753
|
-
while (str.length < digits) {
|
|
3754
|
-
str = character[0]+str;
|
|
3755
|
-
}
|
|
3756
|
-
return str;
|
|
3757
|
-
}
|
|
3758
|
-
|
|
3759
|
-
function leadingNulls(value, digits) {
|
|
3760
|
-
return leadingSomething(value, digits, '0');
|
|
3761
|
-
}
|
|
3762
|
-
|
|
3763
|
-
function compareByDay(date1, date2) {
|
|
3764
|
-
function sgn(value) {
|
|
3765
|
-
return value < 0 ? -1 : (value > 0 ? 1 : 0);
|
|
3766
|
-
}
|
|
3767
|
-
|
|
3768
|
-
var compare;
|
|
3769
|
-
if ((compare = sgn(date1.getFullYear()-date2.getFullYear())) === 0) {
|
|
3770
|
-
if ((compare = sgn(date1.getMonth()-date2.getMonth())) === 0) {
|
|
3771
|
-
compare = sgn(date1.getDate()-date2.getDate());
|
|
3772
|
-
}
|
|
3773
|
-
}
|
|
3774
|
-
return compare;
|
|
3775
|
-
}
|
|
3776
|
-
|
|
3777
|
-
function getFirstWeekStartDate(janFourth) {
|
|
3778
|
-
switch (janFourth.getDay()) {
|
|
3779
|
-
case 0: // Sunday
|
|
3780
|
-
return new Date(janFourth.getFullYear()-1, 11, 29);
|
|
3781
|
-
case 1: // Monday
|
|
3782
|
-
return janFourth;
|
|
3783
|
-
case 2: // Tuesday
|
|
3784
|
-
return new Date(janFourth.getFullYear(), 0, 3);
|
|
3785
|
-
case 3: // Wednesday
|
|
3786
|
-
return new Date(janFourth.getFullYear(), 0, 2);
|
|
3787
|
-
case 4: // Thursday
|
|
3788
|
-
return new Date(janFourth.getFullYear(), 0, 1);
|
|
3789
|
-
case 5: // Friday
|
|
3790
|
-
return new Date(janFourth.getFullYear()-1, 11, 31);
|
|
3791
|
-
case 6: // Saturday
|
|
3792
|
-
return new Date(janFourth.getFullYear()-1, 11, 30);
|
|
3793
|
-
}
|
|
3794
|
-
}
|
|
3795
|
-
|
|
3796
|
-
function getWeekBasedYear(date) {
|
|
3797
|
-
var thisDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);
|
|
3798
|
-
|
|
3799
|
-
var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);
|
|
3800
|
-
var janFourthNextYear = new Date(thisDate.getFullYear()+1, 0, 4);
|
|
3801
|
-
|
|
3802
|
-
var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);
|
|
3803
|
-
var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);
|
|
3804
|
-
|
|
3805
|
-
if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) {
|
|
3806
|
-
// this date is after the start of the first week of this year
|
|
3807
|
-
if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) {
|
|
3808
|
-
return thisDate.getFullYear()+1;
|
|
3809
|
-
} else {
|
|
3810
|
-
return thisDate.getFullYear();
|
|
3811
|
-
}
|
|
3812
|
-
} else {
|
|
3813
|
-
return thisDate.getFullYear()-1;
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
|
|
3817
|
-
var EXPANSION_RULES_2 = {
|
|
3818
|
-
'%a': function(date) {
|
|
3819
|
-
return WEEKDAYS[date.tm_wday].substring(0,3);
|
|
3820
|
-
},
|
|
3821
|
-
'%A': function(date) {
|
|
3822
|
-
return WEEKDAYS[date.tm_wday];
|
|
3823
|
-
},
|
|
3824
|
-
'%b': function(date) {
|
|
3825
|
-
return MONTHS[date.tm_mon].substring(0,3);
|
|
3826
|
-
},
|
|
3827
|
-
'%B': function(date) {
|
|
3828
|
-
return MONTHS[date.tm_mon];
|
|
3829
|
-
},
|
|
3830
|
-
'%C': function(date) {
|
|
3831
|
-
var year = date.tm_year+1900;
|
|
3832
|
-
return leadingNulls((year/100)|0,2);
|
|
3833
|
-
},
|
|
3834
|
-
'%d': function(date) {
|
|
3835
|
-
return leadingNulls(date.tm_mday, 2);
|
|
3836
|
-
},
|
|
3837
|
-
'%e': function(date) {
|
|
3838
|
-
return leadingSomething(date.tm_mday, 2, ' ');
|
|
3839
|
-
},
|
|
3840
|
-
'%g': function(date) {
|
|
3841
|
-
// %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year.
|
|
3842
|
-
// In this system, weeks begin on a Monday and week 1 of the year is the week that includes
|
|
3843
|
-
// January 4th, which is also the week that includes the first Thursday of the year, and
|
|
3844
|
-
// is also the first week that contains at least four days in the year.
|
|
3845
|
-
// If the first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
|
|
3846
|
-
// the last week of the preceding year; thus, for Saturday 2nd January 1999,
|
|
3847
|
-
// %G is replaced by 1998 and %V is replaced by 53. If December 29th, 30th,
|
|
3848
|
-
// or 31st is a Monday, it and any following days are part of week 1 of the following year.
|
|
3849
|
-
// Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.
|
|
3850
|
-
|
|
3851
|
-
return getWeekBasedYear(date).toString().substring(2);
|
|
3852
|
-
},
|
|
3853
|
-
'%G': function(date) {
|
|
3854
|
-
return getWeekBasedYear(date);
|
|
3855
|
-
},
|
|
3856
|
-
'%H': function(date) {
|
|
3857
|
-
return leadingNulls(date.tm_hour, 2);
|
|
3858
|
-
},
|
|
3859
|
-
'%I': function(date) {
|
|
3860
|
-
var twelveHour = date.tm_hour;
|
|
3861
|
-
if (twelveHour == 0) twelveHour = 12;
|
|
3862
|
-
else if (twelveHour > 12) twelveHour -= 12;
|
|
3863
|
-
return leadingNulls(twelveHour, 2);
|
|
3864
|
-
},
|
|
3865
|
-
'%j': function(date) {
|
|
3866
|
-
// Day of the year (001-366)
|
|
3867
|
-
return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date.tm_mon-1), 3);
|
|
3868
|
-
},
|
|
3869
|
-
'%m': function(date) {
|
|
3870
|
-
return leadingNulls(date.tm_mon+1, 2);
|
|
3871
|
-
},
|
|
3872
|
-
'%M': function(date) {
|
|
3873
|
-
return leadingNulls(date.tm_min, 2);
|
|
3874
|
-
},
|
|
3875
|
-
'%n': function() {
|
|
3876
|
-
return '\n';
|
|
3877
|
-
},
|
|
3878
|
-
'%p': function(date) {
|
|
3879
|
-
if (date.tm_hour >= 0 && date.tm_hour < 12) {
|
|
3880
|
-
return 'AM';
|
|
3881
|
-
} else {
|
|
3882
|
-
return 'PM';
|
|
3883
|
-
}
|
|
3884
|
-
},
|
|
3885
|
-
'%S': function(date) {
|
|
3886
|
-
return leadingNulls(date.tm_sec, 2);
|
|
3887
|
-
},
|
|
3888
|
-
'%t': function() {
|
|
3889
|
-
return '\t';
|
|
3890
|
-
},
|
|
3891
|
-
'%u': function(date) {
|
|
3892
|
-
return date.tm_wday || 7;
|
|
3893
|
-
},
|
|
3894
|
-
'%U': function(date) {
|
|
3895
|
-
// Replaced by the week number of the year as a decimal number [00,53].
|
|
3896
|
-
// The first Sunday of January is the first day of week 1;
|
|
3897
|
-
// days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
|
|
3898
|
-
var janFirst = new Date(date.tm_year+1900, 0, 1);
|
|
3899
|
-
var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7-janFirst.getDay());
|
|
3900
|
-
var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);
|
|
3901
|
-
|
|
3902
|
-
// is target date after the first Sunday?
|
|
3903
|
-
if (compareByDay(firstSunday, endDate) < 0) {
|
|
3904
|
-
// calculate difference in days between first Sunday and endDate
|
|
3905
|
-
var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;
|
|
3906
|
-
var firstSundayUntilEndJanuary = 31-firstSunday.getDate();
|
|
3907
|
-
var days = firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();
|
|
3908
|
-
return leadingNulls(Math.ceil(days/7), 2);
|
|
3909
|
-
}
|
|
3910
|
-
|
|
3911
|
-
return compareByDay(firstSunday, janFirst) === 0 ? '01': '00';
|
|
3912
|
-
},
|
|
3913
|
-
'%V': function(date) {
|
|
3914
|
-
// Replaced by the week number of the year (Monday as the first day of the week)
|
|
3915
|
-
// as a decimal number [01,53]. If the week containing 1 January has four
|
|
3916
|
-
// or more days in the new year, then it is considered week 1.
|
|
3917
|
-
// Otherwise, it is the last week of the previous year, and the next week is week 1.
|
|
3918
|
-
// Both January 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]
|
|
3919
|
-
var janFourthThisYear = new Date(date.tm_year+1900, 0, 4);
|
|
3920
|
-
var janFourthNextYear = new Date(date.tm_year+1901, 0, 4);
|
|
3921
|
-
|
|
3922
|
-
var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);
|
|
3923
|
-
var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);
|
|
3924
|
-
|
|
3925
|
-
var endDate = __addDays(new Date(date.tm_year+1900, 0, 1), date.tm_yday);
|
|
3926
|
-
|
|
3927
|
-
if (compareByDay(endDate, firstWeekStartThisYear) < 0) {
|
|
3928
|
-
// if given date is before this years first week, then it belongs to the 53rd week of last year
|
|
3929
|
-
return '53';
|
|
3930
|
-
}
|
|
3931
|
-
|
|
3932
|
-
if (compareByDay(firstWeekStartNextYear, endDate) <= 0) {
|
|
3933
|
-
// if given date is after next years first week, then it belongs to the 01th week of next year
|
|
3934
|
-
return '01';
|
|
3935
|
-
}
|
|
3936
|
-
|
|
3937
|
-
// given date is in between CW 01..53 of this calendar year
|
|
3938
|
-
var daysDifference;
|
|
3939
|
-
if (firstWeekStartThisYear.getFullYear() < date.tm_year+1900) {
|
|
3940
|
-
// first CW of this year starts last year
|
|
3941
|
-
daysDifference = date.tm_yday+32-firstWeekStartThisYear.getDate()
|
|
3942
|
-
} else {
|
|
3943
|
-
// first CW of this year starts this year
|
|
3944
|
-
daysDifference = date.tm_yday+1-firstWeekStartThisYear.getDate();
|
|
3945
|
-
}
|
|
3946
|
-
return leadingNulls(Math.ceil(daysDifference/7), 2);
|
|
3947
|
-
},
|
|
3948
|
-
'%w': function(date) {
|
|
3949
|
-
return date.tm_wday;
|
|
3950
|
-
},
|
|
3951
|
-
'%W': function(date) {
|
|
3952
|
-
// Replaced by the week number of the year as a decimal number [00,53].
|
|
3953
|
-
// The first Monday of January is the first day of week 1;
|
|
3954
|
-
// days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
|
|
3955
|
-
var janFirst = new Date(date.tm_year, 0, 1);
|
|
3956
|
-
var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7-janFirst.getDay()+1);
|
|
3957
|
-
var endDate = new Date(date.tm_year+1900, date.tm_mon, date.tm_mday);
|
|
3958
|
-
|
|
3959
|
-
// is target date after the first Monday?
|
|
3960
|
-
if (compareByDay(firstMonday, endDate) < 0) {
|
|
3961
|
-
var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth()-1)-31;
|
|
3962
|
-
var firstMondayUntilEndJanuary = 31-firstMonday.getDate();
|
|
3963
|
-
var days = firstMondayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();
|
|
3964
|
-
return leadingNulls(Math.ceil(days/7), 2);
|
|
3965
|
-
}
|
|
3966
|
-
return compareByDay(firstMonday, janFirst) === 0 ? '01': '00';
|
|
3967
|
-
},
|
|
3968
|
-
'%y': function(date) {
|
|
3969
|
-
// Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]
|
|
3970
|
-
return (date.tm_year+1900).toString().substring(2);
|
|
3971
|
-
},
|
|
3972
|
-
'%Y': function(date) {
|
|
3973
|
-
// Replaced by the year as a decimal number (for example, 1997). [ tm_year]
|
|
3974
|
-
return date.tm_year+1900;
|
|
3975
|
-
},
|
|
3976
|
-
'%z': function(date) {
|
|
3977
|
-
// Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ).
|
|
3978
|
-
// For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich).
|
|
3979
|
-
var off = date.tm_gmtoff;
|
|
3980
|
-
var ahead = off >= 0;
|
|
3981
|
-
off = Math.abs(off) / 60;
|
|
3982
|
-
// convert from minutes into hhmm format (which means 60 minutes = 100 units)
|
|
3983
|
-
off = (off / 60)*100 + (off % 60);
|
|
3984
|
-
return (ahead ? '+' : '-') + String("0000" + off).slice(-4);
|
|
3985
|
-
},
|
|
3986
|
-
'%Z': function(date) {
|
|
3987
|
-
return date.tm_zone;
|
|
3988
|
-
},
|
|
3989
|
-
'%%': function() {
|
|
3990
|
-
return '%';
|
|
3991
|
-
}
|
|
3992
|
-
};
|
|
3993
|
-
for (var rule in EXPANSION_RULES_2) {
|
|
3994
|
-
if (pattern.indexOf(rule) >= 0) {
|
|
3995
|
-
pattern = pattern.replace(new RegExp(rule, 'g'), EXPANSION_RULES_2[rule](date));
|
|
3996
|
-
}
|
|
3997
|
-
}
|
|
3998
|
-
|
|
3999
|
-
var bytes = intArrayFromString(pattern, false);
|
|
4000
|
-
if (bytes.length > maxsize) {
|
|
4001
|
-
return 0;
|
|
4002
|
-
}
|
|
4003
|
-
|
|
4004
|
-
writeArrayToMemory(bytes, s);
|
|
4005
|
-
return bytes.length-1;
|
|
4006
|
-
}
|
|
4007
|
-
function _strftime_l(s, maxsize, format, tm) {
|
|
4008
|
-
return _strftime(s, maxsize, format, tm); // no locale support yet
|
|
4009
|
-
}
|
|
4010
|
-
embind_init_charCodes();
|
|
4011
|
-
BindingError = Module['BindingError'] = extendError(Error, 'BindingError');;
|
|
4012
|
-
InternalError = Module['InternalError'] = extendError(Error, 'InternalError');;
|
|
4013
|
-
init_ClassHandle();
|
|
4014
|
-
init_RegisteredPointer();
|
|
4015
|
-
init_embind();;
|
|
4016
|
-
UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError');;
|
|
4017
|
-
init_emval();;
|
|
4018
|
-
var ASSERTIONS = true;
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
/** @type {function(string, boolean=, number=)} */
|
|
4023
|
-
function intArrayFromString(stringy, dontAddNull, length) {
|
|
4024
|
-
var len = length > 0 ? length : lengthBytesUTF8(stringy)+1;
|
|
4025
|
-
var u8array = new Array(len);
|
|
4026
|
-
var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
|
|
4027
|
-
if (dontAddNull) u8array.length = numBytesWritten;
|
|
4028
|
-
return u8array;
|
|
4029
|
-
}
|
|
4030
|
-
|
|
4031
|
-
function intArrayToString(array) {
|
|
4032
|
-
var ret = [];
|
|
4033
|
-
for (var i = 0; i < array.length; i++) {
|
|
4034
|
-
var chr = array[i];
|
|
4035
|
-
if (chr > 0xFF) {
|
|
4036
|
-
if (ASSERTIONS) {
|
|
4037
|
-
assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ') at offset ' + i + ' not in 0x00-0xFF.');
|
|
4038
|
-
}
|
|
4039
|
-
chr &= 0xFF;
|
|
4040
|
-
}
|
|
4041
|
-
ret.push(String.fromCharCode(chr));
|
|
4042
|
-
}
|
|
4043
|
-
return ret.join('');
|
|
4044
|
-
}
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
__ATINIT__.push({ func: function() { ___wasm_call_ctors() } });
|
|
4049
|
-
var asmLibraryArg = {
|
|
4050
|
-
"__assert_fail": ___assert_fail,
|
|
4051
|
-
"__cxa_allocate_exception": ___cxa_allocate_exception,
|
|
4052
|
-
"__cxa_atexit": ___cxa_atexit,
|
|
4053
|
-
"__cxa_throw": ___cxa_throw,
|
|
4054
|
-
"_embind_register_bool": __embind_register_bool,
|
|
4055
|
-
"_embind_register_class": __embind_register_class,
|
|
4056
|
-
"_embind_register_class_constructor": __embind_register_class_constructor,
|
|
4057
|
-
"_embind_register_class_function": __embind_register_class_function,
|
|
4058
|
-
"_embind_register_emval": __embind_register_emval,
|
|
4059
|
-
"_embind_register_float": __embind_register_float,
|
|
4060
|
-
"_embind_register_integer": __embind_register_integer,
|
|
4061
|
-
"_embind_register_memory_view": __embind_register_memory_view,
|
|
4062
|
-
"_embind_register_smart_ptr": __embind_register_smart_ptr,
|
|
4063
|
-
"_embind_register_std_string": __embind_register_std_string,
|
|
4064
|
-
"_embind_register_std_wstring": __embind_register_std_wstring,
|
|
4065
|
-
"_embind_register_void": __embind_register_void,
|
|
4066
|
-
"_emval_call": __emval_call,
|
|
4067
|
-
"_emval_decref": __emval_decref,
|
|
4068
|
-
"_emval_incref": __emval_incref,
|
|
4069
|
-
"_emval_new_array": __emval_new_array,
|
|
4070
|
-
"_emval_new_cstring": __emval_new_cstring,
|
|
4071
|
-
"_emval_new_object": __emval_new_object,
|
|
4072
|
-
"_emval_set_property": __emval_set_property,
|
|
4073
|
-
"_emval_take_value": __emval_take_value,
|
|
4074
|
-
"abort": _abort,
|
|
4075
|
-
"emscripten_memcpy_big": _emscripten_memcpy_big,
|
|
4076
|
-
"emscripten_resize_heap": _emscripten_resize_heap,
|
|
4077
|
-
"environ_get": _environ_get,
|
|
4078
|
-
"environ_sizes_get": _environ_sizes_get,
|
|
4079
|
-
"fd_close": _fd_close,
|
|
4080
|
-
"fd_seek": _fd_seek,
|
|
4081
|
-
"fd_write": _fd_write,
|
|
4082
|
-
"memory": wasmMemory,
|
|
4083
|
-
"pthread_rwlock_destroy": _pthread_rwlock_destroy,
|
|
4084
|
-
"pthread_rwlock_init": _pthread_rwlock_init,
|
|
4085
|
-
"pthread_rwlock_rdlock": _pthread_rwlock_rdlock,
|
|
4086
|
-
"pthread_rwlock_unlock": _pthread_rwlock_unlock,
|
|
4087
|
-
"pthread_rwlock_wrlock": _pthread_rwlock_wrlock,
|
|
4088
|
-
"setTempRet0": _setTempRet0,
|
|
4089
|
-
"strftime_l": _strftime_l
|
|
4090
|
-
};
|
|
4091
|
-
var asm = createWasm();
|
|
4092
|
-
/** @type {function(...*):?} */
|
|
4093
|
-
var ___wasm_call_ctors = Module["___wasm_call_ctors"] = createExportWrapper("__wasm_call_ctors", asm);
|
|
4094
|
-
|
|
4095
|
-
/** @type {function(...*):?} */
|
|
4096
|
-
var _malloc = Module["_malloc"] = createExportWrapper("malloc", asm);
|
|
4097
|
-
|
|
4098
|
-
/** @type {function(...*):?} */
|
|
4099
|
-
var ___errno_location = Module["___errno_location"] = createExportWrapper("__errno_location", asm);
|
|
4100
|
-
|
|
4101
|
-
/** @type {function(...*):?} */
|
|
4102
|
-
var ___getTypeName = Module["___getTypeName"] = createExportWrapper("__getTypeName", asm);
|
|
4103
|
-
|
|
4104
|
-
/** @type {function(...*):?} */
|
|
4105
|
-
var ___embind_register_native_and_builtin_types = Module["___embind_register_native_and_builtin_types"] = createExportWrapper("__embind_register_native_and_builtin_types", asm);
|
|
4106
|
-
|
|
4107
|
-
/** @type {function(...*):?} */
|
|
4108
|
-
var _fflush = Module["_fflush"] = createExportWrapper("fflush", asm);
|
|
4109
|
-
|
|
4110
|
-
/** @type {function(...*):?} */
|
|
4111
|
-
var stackSave = Module["stackSave"] = createExportWrapper("stackSave", asm);
|
|
4112
|
-
|
|
4113
|
-
/** @type {function(...*):?} */
|
|
4114
|
-
var stackRestore = Module["stackRestore"] = createExportWrapper("stackRestore", asm);
|
|
4115
|
-
|
|
4116
|
-
/** @type {function(...*):?} */
|
|
4117
|
-
var stackAlloc = Module["stackAlloc"] = createExportWrapper("stackAlloc", asm);
|
|
4118
|
-
|
|
4119
|
-
/** @type {function(...*):?} */
|
|
4120
|
-
var _emscripten_stack_init = Module["_emscripten_stack_init"] = asm["emscripten_stack_init"]
|
|
4121
|
-
|
|
4122
|
-
/** @type {function(...*):?} */
|
|
4123
|
-
var _emscripten_stack_get_free = Module["_emscripten_stack_get_free"] = asm["emscripten_stack_get_free"]
|
|
4124
|
-
|
|
4125
|
-
/** @type {function(...*):?} */
|
|
4126
|
-
var _emscripten_stack_get_end = Module["_emscripten_stack_get_end"] = asm["emscripten_stack_get_end"]
|
|
4127
|
-
|
|
4128
|
-
/** @type {function(...*):?} */
|
|
4129
|
-
var _setThrew = Module["_setThrew"] = createExportWrapper("setThrew", asm);
|
|
4130
|
-
|
|
4131
|
-
/** @type {function(...*):?} */
|
|
4132
|
-
var _free = Module["_free"] = createExportWrapper("free", asm);
|
|
4133
|
-
|
|
4134
|
-
/** @type {function(...*):?} */
|
|
4135
|
-
var dynCall_viijii = Module["dynCall_viijii"] = createExportWrapper("dynCall_viijii", asm);
|
|
4136
|
-
|
|
4137
|
-
/** @type {function(...*):?} */
|
|
4138
|
-
var dynCall_iiiij = Module["dynCall_iiiij"] = createExportWrapper("dynCall_iiiij", asm);
|
|
4139
|
-
|
|
4140
|
-
/** @type {function(...*):?} */
|
|
4141
|
-
var dynCall_jiji = Module["dynCall_jiji"] = createExportWrapper("dynCall_jiji", asm);
|
|
4142
|
-
|
|
4143
|
-
/** @type {function(...*):?} */
|
|
4144
|
-
var dynCall_iiiiij = Module["dynCall_iiiiij"] = createExportWrapper("dynCall_iiiiij", asm);
|
|
4145
|
-
|
|
4146
|
-
/** @type {function(...*):?} */
|
|
4147
|
-
var dynCall_iiiiijj = Module["dynCall_iiiiijj"] = createExportWrapper("dynCall_iiiiijj", asm);
|
|
4148
|
-
|
|
4149
|
-
/** @type {function(...*):?} */
|
|
4150
|
-
var dynCall_iiiiiijj = Module["dynCall_iiiiiijj"] = createExportWrapper("dynCall_iiiiiijj", asm);
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
// === Auto-generated postamble setup entry stuff ===
|
|
4157
|
-
|
|
4158
|
-
if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function() { abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4159
|
-
if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function() { abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4160
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function() { abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4161
|
-
if (!Object.getOwnPropertyDescriptor(Module, "cwrap")) Module["cwrap"] = function() { abort("'cwrap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4162
|
-
if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function() { abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4163
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function() { abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4164
|
-
if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function() { abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4165
|
-
if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function() { abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4166
|
-
if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function() { abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4167
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function() { abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4168
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function() { abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4169
|
-
if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function() { abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4170
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function() { abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4171
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function() { abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4172
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function() { abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4173
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function() { abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4174
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function() { abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4175
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function() { abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4176
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function() { abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4177
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function() { abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4178
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function() { abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4179
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function() { abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4180
|
-
if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function() { abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4181
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function() { abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4182
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function() { abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4183
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function() { abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4184
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function() { abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4185
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function() { abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4186
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function() { abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4187
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function() { abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4188
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function() { abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you") };
|
|
4189
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function() { abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4190
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function() { abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4191
|
-
if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function() { abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4192
|
-
if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function() { abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4193
|
-
if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function() { abort("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4194
|
-
if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function() { abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4195
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function() { abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4196
|
-
if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function() { abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4197
|
-
if (!Object.getOwnPropertyDescriptor(Module, "makeBigInt")) Module["makeBigInt"] = function() { abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4198
|
-
if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function() { abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4199
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function() { abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4200
|
-
if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function() { abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4201
|
-
if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function() { abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4202
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function() { abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4203
|
-
if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function() { abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4204
|
-
if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function() { abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4205
|
-
if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function() { abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4206
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function() { abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4207
|
-
if (!Object.getOwnPropertyDescriptor(Module, "setFileTime")) Module["setFileTime"] = function() { abort("'setFileTime' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4208
|
-
if (!Object.getOwnPropertyDescriptor(Module, "abortOnCannotGrowMemory")) Module["abortOnCannotGrowMemory"] = function() { abort("'abortOnCannotGrowMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4209
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function() { abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4210
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function() { abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4211
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function() { abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4212
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function() { abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4213
|
-
if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function() { abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4214
|
-
if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function() { abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4215
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getHostByName")) Module["getHostByName"] = function() { abort("'getHostByName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4216
|
-
if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function() { abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4217
|
-
if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function() { abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4218
|
-
if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function() { abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4219
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getRandomDevice")) Module["getRandomDevice"] = function() { abort("'getRandomDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4220
|
-
if (!Object.getOwnPropertyDescriptor(Module, "traverseStack")) Module["traverseStack"] = function() { abort("'traverseStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4221
|
-
if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function() { abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4222
|
-
if (!Object.getOwnPropertyDescriptor(Module, "withBuiltinMalloc")) Module["withBuiltinMalloc"] = function() { abort("'withBuiltinMalloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4223
|
-
if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgsArray")) Module["readAsmConstArgsArray"] = function() { abort("'readAsmConstArgsArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4224
|
-
if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function() { abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4225
|
-
if (!Object.getOwnPropertyDescriptor(Module, "mainThreadEM_ASM")) Module["mainThreadEM_ASM"] = function() { abort("'mainThreadEM_ASM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4226
|
-
if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function() { abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4227
|
-
if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function() { abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4228
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getExecutableName")) Module["getExecutableName"] = function() { abort("'getExecutableName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4229
|
-
if (!Object.getOwnPropertyDescriptor(Module, "listenOnce")) Module["listenOnce"] = function() { abort("'listenOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4230
|
-
if (!Object.getOwnPropertyDescriptor(Module, "autoResumeAudioContext")) Module["autoResumeAudioContext"] = function() { abort("'autoResumeAudioContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4231
|
-
if (!Object.getOwnPropertyDescriptor(Module, "dynCallLegacy")) Module["dynCallLegacy"] = function() { abort("'dynCallLegacy' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4232
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getDynCaller")) Module["getDynCaller"] = function() { abort("'getDynCaller' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4233
|
-
if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function() { abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4234
|
-
if (!Object.getOwnPropertyDescriptor(Module, "callRuntimeCallbacks")) Module["callRuntimeCallbacks"] = function() { abort("'callRuntimeCallbacks' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4235
|
-
if (!Object.getOwnPropertyDescriptor(Module, "abortStackOverflow")) Module["abortStackOverflow"] = function() { abort("'abortStackOverflow' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4236
|
-
if (!Object.getOwnPropertyDescriptor(Module, "reallyNegative")) Module["reallyNegative"] = function() { abort("'reallyNegative' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4237
|
-
if (!Object.getOwnPropertyDescriptor(Module, "unSign")) Module["unSign"] = function() { abort("'unSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4238
|
-
if (!Object.getOwnPropertyDescriptor(Module, "reSign")) Module["reSign"] = function() { abort("'reSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4239
|
-
if (!Object.getOwnPropertyDescriptor(Module, "formatString")) Module["formatString"] = function() { abort("'formatString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4240
|
-
if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function() { abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4241
|
-
if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function() { abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4242
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function() { abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4243
|
-
if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function() { abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4244
|
-
if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function() { abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4245
|
-
if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function() { abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4246
|
-
if (!Object.getOwnPropertyDescriptor(Module, "specialHTMLTargets")) Module["specialHTMLTargets"] = function() { abort("'specialHTMLTargets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4247
|
-
if (!Object.getOwnPropertyDescriptor(Module, "maybeCStringToJsString")) Module["maybeCStringToJsString"] = function() { abort("'maybeCStringToJsString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4248
|
-
if (!Object.getOwnPropertyDescriptor(Module, "findEventTarget")) Module["findEventTarget"] = function() { abort("'findEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4249
|
-
if (!Object.getOwnPropertyDescriptor(Module, "findCanvasEventTarget")) Module["findCanvasEventTarget"] = function() { abort("'findCanvasEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4250
|
-
if (!Object.getOwnPropertyDescriptor(Module, "polyfillSetImmediate")) Module["polyfillSetImmediate"] = function() { abort("'polyfillSetImmediate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4251
|
-
if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function() { abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4252
|
-
if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function() { abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4253
|
-
if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function() { abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4254
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function() { abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4255
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function() { abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4256
|
-
if (!Object.getOwnPropertyDescriptor(Module, "checkWasiClock")) Module["checkWasiClock"] = function() { abort("'checkWasiClock' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4257
|
-
if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function() { abort("'flush_NO_FILESYSTEM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4258
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function() { abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4259
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function() { abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4260
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function() { abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4261
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function() { abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4262
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function() { abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4263
|
-
if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function() { abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4264
|
-
if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function() { abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4265
|
-
if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function() { abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4266
|
-
if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function() { abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4267
|
-
if (!Object.getOwnPropertyDescriptor(Module, "uncaughtExceptionCount")) Module["uncaughtExceptionCount"] = function() { abort("'uncaughtExceptionCount' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4268
|
-
if (!Object.getOwnPropertyDescriptor(Module, "exceptionLast")) Module["exceptionLast"] = function() { abort("'exceptionLast' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4269
|
-
if (!Object.getOwnPropertyDescriptor(Module, "exceptionCaught")) Module["exceptionCaught"] = function() { abort("'exceptionCaught' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4270
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ExceptionInfoAttrs")) Module["ExceptionInfoAttrs"] = function() { abort("'ExceptionInfoAttrs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4271
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ExceptionInfo")) Module["ExceptionInfo"] = function() { abort("'ExceptionInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4272
|
-
if (!Object.getOwnPropertyDescriptor(Module, "CatchInfo")) Module["CatchInfo"] = function() { abort("'CatchInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4273
|
-
if (!Object.getOwnPropertyDescriptor(Module, "exception_addRef")) Module["exception_addRef"] = function() { abort("'exception_addRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4274
|
-
if (!Object.getOwnPropertyDescriptor(Module, "exception_decRef")) Module["exception_decRef"] = function() { abort("'exception_decRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4275
|
-
if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function() { abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4276
|
-
if (!Object.getOwnPropertyDescriptor(Module, "funcWrappers")) Module["funcWrappers"] = function() { abort("'funcWrappers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4277
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function() { abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4278
|
-
if (!Object.getOwnPropertyDescriptor(Module, "setMainLoop")) Module["setMainLoop"] = function() { abort("'setMainLoop' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4279
|
-
if (!Object.getOwnPropertyDescriptor(Module, "FS")) Module["FS"] = function() { abort("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4280
|
-
if (!Object.getOwnPropertyDescriptor(Module, "mmapAlloc")) Module["mmapAlloc"] = function() { abort("'mmapAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4281
|
-
if (!Object.getOwnPropertyDescriptor(Module, "MEMFS")) Module["MEMFS"] = function() { abort("'MEMFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4282
|
-
if (!Object.getOwnPropertyDescriptor(Module, "TTY")) Module["TTY"] = function() { abort("'TTY' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4283
|
-
if (!Object.getOwnPropertyDescriptor(Module, "PIPEFS")) Module["PIPEFS"] = function() { abort("'PIPEFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4284
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SOCKFS")) Module["SOCKFS"] = function() { abort("'SOCKFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4285
|
-
if (!Object.getOwnPropertyDescriptor(Module, "tempFixedLengthArray")) Module["tempFixedLengthArray"] = function() { abort("'tempFixedLengthArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4286
|
-
if (!Object.getOwnPropertyDescriptor(Module, "miniTempWebGLFloatBuffers")) Module["miniTempWebGLFloatBuffers"] = function() { abort("'miniTempWebGLFloatBuffers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4287
|
-
if (!Object.getOwnPropertyDescriptor(Module, "heapObjectForWebGLType")) Module["heapObjectForWebGLType"] = function() { abort("'heapObjectForWebGLType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4288
|
-
if (!Object.getOwnPropertyDescriptor(Module, "heapAccessShiftForWebGLHeap")) Module["heapAccessShiftForWebGLHeap"] = function() { abort("'heapAccessShiftForWebGLHeap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4289
|
-
if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function() { abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4290
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function() { abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4291
|
-
if (!Object.getOwnPropertyDescriptor(Module, "computeUnpackAlignedImageSize")) Module["computeUnpackAlignedImageSize"] = function() { abort("'computeUnpackAlignedImageSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4292
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function() { abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4293
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function() { abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4294
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function() { abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4295
|
-
if (!Object.getOwnPropertyDescriptor(Module, "writeGLArray")) Module["writeGLArray"] = function() { abort("'writeGLArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4296
|
-
if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function() { abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4297
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function() { abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4298
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function() { abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4299
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function() { abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4300
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function() { abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4301
|
-
if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function() { abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4302
|
-
if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function() { abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4303
|
-
if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function() { abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4304
|
-
if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function() { abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4305
|
-
if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function() { abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4306
|
-
if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function() { abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4307
|
-
if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function() { abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4308
|
-
if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function() { abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4309
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emval_handle_array")) Module["emval_handle_array"] = function() { abort("'emval_handle_array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4310
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emval_free_list")) Module["emval_free_list"] = function() { abort("'emval_free_list' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4311
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emval_symbols")) Module["emval_symbols"] = function() { abort("'emval_symbols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4312
|
-
if (!Object.getOwnPropertyDescriptor(Module, "init_emval")) Module["init_emval"] = function() { abort("'init_emval' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4313
|
-
if (!Object.getOwnPropertyDescriptor(Module, "count_emval_handles")) Module["count_emval_handles"] = function() { abort("'count_emval_handles' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4314
|
-
if (!Object.getOwnPropertyDescriptor(Module, "get_first_emval")) Module["get_first_emval"] = function() { abort("'get_first_emval' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4315
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getStringOrSymbol")) Module["getStringOrSymbol"] = function() { abort("'getStringOrSymbol' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4316
|
-
if (!Object.getOwnPropertyDescriptor(Module, "requireHandle")) Module["requireHandle"] = function() { abort("'requireHandle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4317
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emval_newers")) Module["emval_newers"] = function() { abort("'emval_newers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4318
|
-
if (!Object.getOwnPropertyDescriptor(Module, "craftEmvalAllocator")) Module["craftEmvalAllocator"] = function() { abort("'craftEmvalAllocator' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4319
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emval_get_global")) Module["emval_get_global"] = function() { abort("'emval_get_global' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4320
|
-
if (!Object.getOwnPropertyDescriptor(Module, "emval_methodCallers")) Module["emval_methodCallers"] = function() { abort("'emval_methodCallers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4321
|
-
if (!Object.getOwnPropertyDescriptor(Module, "InternalError")) Module["InternalError"] = function() { abort("'InternalError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4322
|
-
if (!Object.getOwnPropertyDescriptor(Module, "BindingError")) Module["BindingError"] = function() { abort("'BindingError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4323
|
-
if (!Object.getOwnPropertyDescriptor(Module, "UnboundTypeError")) Module["UnboundTypeError"] = function() { abort("'UnboundTypeError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4324
|
-
if (!Object.getOwnPropertyDescriptor(Module, "PureVirtualError")) Module["PureVirtualError"] = function() { abort("'PureVirtualError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4325
|
-
if (!Object.getOwnPropertyDescriptor(Module, "init_embind")) Module["init_embind"] = function() { abort("'init_embind' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4326
|
-
if (!Object.getOwnPropertyDescriptor(Module, "throwInternalError")) Module["throwInternalError"] = function() { abort("'throwInternalError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4327
|
-
if (!Object.getOwnPropertyDescriptor(Module, "throwBindingError")) Module["throwBindingError"] = function() { abort("'throwBindingError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4328
|
-
if (!Object.getOwnPropertyDescriptor(Module, "throwUnboundTypeError")) Module["throwUnboundTypeError"] = function() { abort("'throwUnboundTypeError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4329
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ensureOverloadTable")) Module["ensureOverloadTable"] = function() { abort("'ensureOverloadTable' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4330
|
-
if (!Object.getOwnPropertyDescriptor(Module, "exposePublicSymbol")) Module["exposePublicSymbol"] = function() { abort("'exposePublicSymbol' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4331
|
-
if (!Object.getOwnPropertyDescriptor(Module, "replacePublicSymbol")) Module["replacePublicSymbol"] = function() { abort("'replacePublicSymbol' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4332
|
-
if (!Object.getOwnPropertyDescriptor(Module, "extendError")) Module["extendError"] = function() { abort("'extendError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4333
|
-
if (!Object.getOwnPropertyDescriptor(Module, "createNamedFunction")) Module["createNamedFunction"] = function() { abort("'createNamedFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4334
|
-
if (!Object.getOwnPropertyDescriptor(Module, "registeredInstances")) Module["registeredInstances"] = function() { abort("'registeredInstances' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4335
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getBasestPointer")) Module["getBasestPointer"] = function() { abort("'getBasestPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4336
|
-
if (!Object.getOwnPropertyDescriptor(Module, "registerInheritedInstance")) Module["registerInheritedInstance"] = function() { abort("'registerInheritedInstance' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4337
|
-
if (!Object.getOwnPropertyDescriptor(Module, "unregisterInheritedInstance")) Module["unregisterInheritedInstance"] = function() { abort("'unregisterInheritedInstance' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4338
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getInheritedInstance")) Module["getInheritedInstance"] = function() { abort("'getInheritedInstance' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4339
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getInheritedInstanceCount")) Module["getInheritedInstanceCount"] = function() { abort("'getInheritedInstanceCount' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4340
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getLiveInheritedInstances")) Module["getLiveInheritedInstances"] = function() { abort("'getLiveInheritedInstances' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4341
|
-
if (!Object.getOwnPropertyDescriptor(Module, "registeredTypes")) Module["registeredTypes"] = function() { abort("'registeredTypes' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4342
|
-
if (!Object.getOwnPropertyDescriptor(Module, "awaitingDependencies")) Module["awaitingDependencies"] = function() { abort("'awaitingDependencies' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4343
|
-
if (!Object.getOwnPropertyDescriptor(Module, "typeDependencies")) Module["typeDependencies"] = function() { abort("'typeDependencies' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4344
|
-
if (!Object.getOwnPropertyDescriptor(Module, "registeredPointers")) Module["registeredPointers"] = function() { abort("'registeredPointers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4345
|
-
if (!Object.getOwnPropertyDescriptor(Module, "registerType")) Module["registerType"] = function() { abort("'registerType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4346
|
-
if (!Object.getOwnPropertyDescriptor(Module, "whenDependentTypesAreResolved")) Module["whenDependentTypesAreResolved"] = function() { abort("'whenDependentTypesAreResolved' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4347
|
-
if (!Object.getOwnPropertyDescriptor(Module, "embind_charCodes")) Module["embind_charCodes"] = function() { abort("'embind_charCodes' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4348
|
-
if (!Object.getOwnPropertyDescriptor(Module, "embind_init_charCodes")) Module["embind_init_charCodes"] = function() { abort("'embind_init_charCodes' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4349
|
-
if (!Object.getOwnPropertyDescriptor(Module, "readLatin1String")) Module["readLatin1String"] = function() { abort("'readLatin1String' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4350
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getTypeName")) Module["getTypeName"] = function() { abort("'getTypeName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4351
|
-
if (!Object.getOwnPropertyDescriptor(Module, "heap32VectorToArray")) Module["heap32VectorToArray"] = function() { abort("'heap32VectorToArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4352
|
-
if (!Object.getOwnPropertyDescriptor(Module, "requireRegisteredType")) Module["requireRegisteredType"] = function() { abort("'requireRegisteredType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4353
|
-
if (!Object.getOwnPropertyDescriptor(Module, "getShiftFromSize")) Module["getShiftFromSize"] = function() { abort("'getShiftFromSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4354
|
-
if (!Object.getOwnPropertyDescriptor(Module, "integerReadValueFromPointer")) Module["integerReadValueFromPointer"] = function() { abort("'integerReadValueFromPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4355
|
-
if (!Object.getOwnPropertyDescriptor(Module, "enumReadValueFromPointer")) Module["enumReadValueFromPointer"] = function() { abort("'enumReadValueFromPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4356
|
-
if (!Object.getOwnPropertyDescriptor(Module, "floatReadValueFromPointer")) Module["floatReadValueFromPointer"] = function() { abort("'floatReadValueFromPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4357
|
-
if (!Object.getOwnPropertyDescriptor(Module, "simpleReadValueFromPointer")) Module["simpleReadValueFromPointer"] = function() { abort("'simpleReadValueFromPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4358
|
-
if (!Object.getOwnPropertyDescriptor(Module, "runDestructors")) Module["runDestructors"] = function() { abort("'runDestructors' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4359
|
-
if (!Object.getOwnPropertyDescriptor(Module, "new_")) Module["new_"] = function() { abort("'new_' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4360
|
-
if (!Object.getOwnPropertyDescriptor(Module, "craftInvokerFunction")) Module["craftInvokerFunction"] = function() { abort("'craftInvokerFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4361
|
-
if (!Object.getOwnPropertyDescriptor(Module, "embind__requireFunction")) Module["embind__requireFunction"] = function() { abort("'embind__requireFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4362
|
-
if (!Object.getOwnPropertyDescriptor(Module, "tupleRegistrations")) Module["tupleRegistrations"] = function() { abort("'tupleRegistrations' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4363
|
-
if (!Object.getOwnPropertyDescriptor(Module, "structRegistrations")) Module["structRegistrations"] = function() { abort("'structRegistrations' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4364
|
-
if (!Object.getOwnPropertyDescriptor(Module, "genericPointerToWireType")) Module["genericPointerToWireType"] = function() { abort("'genericPointerToWireType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4365
|
-
if (!Object.getOwnPropertyDescriptor(Module, "constNoSmartPtrRawPointerToWireType")) Module["constNoSmartPtrRawPointerToWireType"] = function() { abort("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4366
|
-
if (!Object.getOwnPropertyDescriptor(Module, "nonConstNoSmartPtrRawPointerToWireType")) Module["nonConstNoSmartPtrRawPointerToWireType"] = function() { abort("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4367
|
-
if (!Object.getOwnPropertyDescriptor(Module, "init_RegisteredPointer")) Module["init_RegisteredPointer"] = function() { abort("'init_RegisteredPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4368
|
-
if (!Object.getOwnPropertyDescriptor(Module, "RegisteredPointer")) Module["RegisteredPointer"] = function() { abort("'RegisteredPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4369
|
-
if (!Object.getOwnPropertyDescriptor(Module, "RegisteredPointer_getPointee")) Module["RegisteredPointer_getPointee"] = function() { abort("'RegisteredPointer_getPointee' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4370
|
-
if (!Object.getOwnPropertyDescriptor(Module, "RegisteredPointer_destructor")) Module["RegisteredPointer_destructor"] = function() { abort("'RegisteredPointer_destructor' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4371
|
-
if (!Object.getOwnPropertyDescriptor(Module, "RegisteredPointer_deleteObject")) Module["RegisteredPointer_deleteObject"] = function() { abort("'RegisteredPointer_deleteObject' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4372
|
-
if (!Object.getOwnPropertyDescriptor(Module, "RegisteredPointer_fromWireType")) Module["RegisteredPointer_fromWireType"] = function() { abort("'RegisteredPointer_fromWireType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4373
|
-
if (!Object.getOwnPropertyDescriptor(Module, "runDestructor")) Module["runDestructor"] = function() { abort("'runDestructor' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4374
|
-
if (!Object.getOwnPropertyDescriptor(Module, "releaseClassHandle")) Module["releaseClassHandle"] = function() { abort("'releaseClassHandle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4375
|
-
if (!Object.getOwnPropertyDescriptor(Module, "finalizationGroup")) Module["finalizationGroup"] = function() { abort("'finalizationGroup' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4376
|
-
if (!Object.getOwnPropertyDescriptor(Module, "detachFinalizer_deps")) Module["detachFinalizer_deps"] = function() { abort("'detachFinalizer_deps' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4377
|
-
if (!Object.getOwnPropertyDescriptor(Module, "detachFinalizer")) Module["detachFinalizer"] = function() { abort("'detachFinalizer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4378
|
-
if (!Object.getOwnPropertyDescriptor(Module, "attachFinalizer")) Module["attachFinalizer"] = function() { abort("'attachFinalizer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4379
|
-
if (!Object.getOwnPropertyDescriptor(Module, "makeClassHandle")) Module["makeClassHandle"] = function() { abort("'makeClassHandle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4380
|
-
if (!Object.getOwnPropertyDescriptor(Module, "init_ClassHandle")) Module["init_ClassHandle"] = function() { abort("'init_ClassHandle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4381
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ClassHandle")) Module["ClassHandle"] = function() { abort("'ClassHandle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4382
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ClassHandle_isAliasOf")) Module["ClassHandle_isAliasOf"] = function() { abort("'ClassHandle_isAliasOf' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4383
|
-
if (!Object.getOwnPropertyDescriptor(Module, "throwInstanceAlreadyDeleted")) Module["throwInstanceAlreadyDeleted"] = function() { abort("'throwInstanceAlreadyDeleted' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4384
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ClassHandle_clone")) Module["ClassHandle_clone"] = function() { abort("'ClassHandle_clone' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4385
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ClassHandle_delete")) Module["ClassHandle_delete"] = function() { abort("'ClassHandle_delete' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4386
|
-
if (!Object.getOwnPropertyDescriptor(Module, "deletionQueue")) Module["deletionQueue"] = function() { abort("'deletionQueue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4387
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ClassHandle_isDeleted")) Module["ClassHandle_isDeleted"] = function() { abort("'ClassHandle_isDeleted' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4388
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ClassHandle_deleteLater")) Module["ClassHandle_deleteLater"] = function() { abort("'ClassHandle_deleteLater' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4389
|
-
if (!Object.getOwnPropertyDescriptor(Module, "flushPendingDeletes")) Module["flushPendingDeletes"] = function() { abort("'flushPendingDeletes' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4390
|
-
if (!Object.getOwnPropertyDescriptor(Module, "delayFunction")) Module["delayFunction"] = function() { abort("'delayFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4391
|
-
if (!Object.getOwnPropertyDescriptor(Module, "setDelayFunction")) Module["setDelayFunction"] = function() { abort("'setDelayFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4392
|
-
if (!Object.getOwnPropertyDescriptor(Module, "RegisteredClass")) Module["RegisteredClass"] = function() { abort("'RegisteredClass' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4393
|
-
if (!Object.getOwnPropertyDescriptor(Module, "shallowCopyInternalPointer")) Module["shallowCopyInternalPointer"] = function() { abort("'shallowCopyInternalPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4394
|
-
if (!Object.getOwnPropertyDescriptor(Module, "downcastPointer")) Module["downcastPointer"] = function() { abort("'downcastPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4395
|
-
if (!Object.getOwnPropertyDescriptor(Module, "upcastPointer")) Module["upcastPointer"] = function() { abort("'upcastPointer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4396
|
-
if (!Object.getOwnPropertyDescriptor(Module, "validateThis")) Module["validateThis"] = function() { abort("'validateThis' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4397
|
-
if (!Object.getOwnPropertyDescriptor(Module, "char_0")) Module["char_0"] = function() { abort("'char_0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4398
|
-
if (!Object.getOwnPropertyDescriptor(Module, "char_9")) Module["char_9"] = function() { abort("'char_9' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4399
|
-
if (!Object.getOwnPropertyDescriptor(Module, "makeLegalFunctionName")) Module["makeLegalFunctionName"] = function() { abort("'makeLegalFunctionName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4400
|
-
if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function() { abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4401
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function() { abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4402
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function() { abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4403
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function() { abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4404
|
-
if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function() { abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4405
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function() { abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4406
|
-
if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function() { abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4407
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function() { abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4408
|
-
if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function() { abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4409
|
-
if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function() { abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4410
|
-
if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function() { abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4411
|
-
if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function() { abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4412
|
-
if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function() { abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4413
|
-
if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function() { abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
|
|
4414
|
-
Module["writeStackCookie"] = writeStackCookie;
|
|
4415
|
-
Module["checkStackCookie"] = checkStackCookie;
|
|
4416
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", { configurable: true, get: function() { abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } });
|
|
4417
|
-
if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", { configurable: true, get: function() { abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") } });
|
|
4418
|
-
|
|
4419
|
-
var calledRun;
|
|
4420
|
-
|
|
4421
|
-
/**
|
|
4422
|
-
* @constructor
|
|
4423
|
-
* @this {ExitStatus}
|
|
4424
|
-
*/
|
|
4425
|
-
function ExitStatus(status) {
|
|
4426
|
-
this.name = "ExitStatus";
|
|
4427
|
-
this.message = "Program terminated with exit(" + status + ")";
|
|
4428
|
-
this.status = status;
|
|
4429
|
-
}
|
|
4430
|
-
|
|
4431
|
-
var calledMain = false;
|
|
4432
|
-
|
|
4433
|
-
dependenciesFulfilled = function runCaller() {
|
|
4434
|
-
// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
|
|
4435
|
-
if (!calledRun) run();
|
|
4436
|
-
if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled
|
|
4437
|
-
};
|
|
4438
|
-
|
|
4439
|
-
/** @type {function(Array=)} */
|
|
4440
|
-
function run(args) {
|
|
4441
|
-
args = args || arguments_;
|
|
4442
|
-
|
|
4443
|
-
if (runDependencies > 0) {
|
|
4444
|
-
return;
|
|
4445
|
-
}
|
|
4446
|
-
|
|
4447
|
-
// This is normally called automatically during __wasm_call_ctors but need to
|
|
4448
|
-
// get these values before even running any of the ctors so we call it redundantly
|
|
4449
|
-
// here.
|
|
4450
|
-
// TODO(sbc): Move writeStackCookie to native to to avoid this.
|
|
4451
|
-
_emscripten_stack_init();
|
|
4452
|
-
writeStackCookie();
|
|
4453
|
-
|
|
4454
|
-
preRun();
|
|
4455
|
-
|
|
4456
|
-
if (runDependencies > 0) return; // a preRun added a dependency, run will be called later
|
|
4457
|
-
|
|
4458
|
-
function doRun() {
|
|
4459
|
-
// run may have just been called through dependencies being fulfilled just in this very frame,
|
|
4460
|
-
// or while the async setStatus time below was happening
|
|
4461
|
-
if (calledRun) return;
|
|
4462
|
-
calledRun = true;
|
|
4463
|
-
Module['calledRun'] = true;
|
|
4464
|
-
|
|
4465
|
-
if (ABORT) return;
|
|
4466
|
-
|
|
4467
|
-
initRuntime();
|
|
4468
|
-
|
|
4469
|
-
preMain();
|
|
4470
|
-
|
|
4471
|
-
if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();
|
|
4472
|
-
|
|
4473
|
-
assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');
|
|
4474
|
-
|
|
4475
|
-
postRun();
|
|
4476
|
-
}
|
|
4477
|
-
|
|
4478
|
-
if (Module['setStatus']) {
|
|
4479
|
-
Module['setStatus']('Running...');
|
|
4480
|
-
setTimeout(function() {
|
|
4481
|
-
setTimeout(function() {
|
|
4482
|
-
Module['setStatus']('');
|
|
4483
|
-
}, 1);
|
|
4484
|
-
doRun();
|
|
4485
|
-
}, 1);
|
|
4486
|
-
} else
|
|
4487
|
-
{
|
|
4488
|
-
doRun();
|
|
4489
|
-
}
|
|
4490
|
-
checkStackCookie();
|
|
4491
|
-
}
|
|
4492
|
-
Module['run'] = run;
|
|
4493
|
-
|
|
4494
|
-
function checkUnflushedContent() {
|
|
4495
|
-
// Compiler settings do not allow exiting the runtime, so flushing
|
|
4496
|
-
// the streams is not possible. but in ASSERTIONS mode we check
|
|
4497
|
-
// if there was something to flush, and if so tell the user they
|
|
4498
|
-
// should request that the runtime be exitable.
|
|
4499
|
-
// Normally we would not even include flush() at all, but in ASSERTIONS
|
|
4500
|
-
// builds we do so just for this check, and here we see if there is any
|
|
4501
|
-
// content to flush, that is, we check if there would have been
|
|
4502
|
-
// something a non-ASSERTIONS build would have not seen.
|
|
4503
|
-
// How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0
|
|
4504
|
-
// mode (which has its own special function for this; otherwise, all
|
|
4505
|
-
// the code is inside libc)
|
|
4506
|
-
var print = out;
|
|
4507
|
-
var printErr = err;
|
|
4508
|
-
var has = false;
|
|
4509
|
-
out = err = function(x) {
|
|
4510
|
-
has = true;
|
|
4511
|
-
}
|
|
4512
|
-
try { // it doesn't matter if it fails
|
|
4513
|
-
var flush = flush_NO_FILESYSTEM;
|
|
4514
|
-
if (flush) flush();
|
|
4515
|
-
} catch(e) {}
|
|
4516
|
-
out = print;
|
|
4517
|
-
err = printErr;
|
|
4518
|
-
if (has) {
|
|
4519
|
-
warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.');
|
|
4520
|
-
warnOnce('(this may also be due to not including full filesystem support - try building with -s FORCE_FILESYSTEM=1)');
|
|
4521
|
-
}
|
|
4522
|
-
}
|
|
4523
|
-
|
|
4524
|
-
/** @param {boolean|number=} implicit */
|
|
4525
|
-
function exit(status, implicit) {
|
|
4526
|
-
checkUnflushedContent();
|
|
4527
|
-
|
|
4528
|
-
// if this is just main exit-ing implicitly, and the status is 0, then we
|
|
4529
|
-
// don't need to do anything here and can just leave. if the status is
|
|
4530
|
-
// non-zero, though, then we need to report it.
|
|
4531
|
-
// (we may have warned about this earlier, if a situation justifies doing so)
|
|
4532
|
-
if (implicit && noExitRuntime && status === 0) {
|
|
4533
|
-
return;
|
|
4534
|
-
}
|
|
4535
|
-
|
|
4536
|
-
if (noExitRuntime) {
|
|
4537
|
-
// if exit() was called, we may warn the user if the runtime isn't actually being shut down
|
|
4538
|
-
if (!implicit) {
|
|
4539
|
-
var msg = 'program exited (with status: ' + status + '), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)';
|
|
4540
|
-
err(msg);
|
|
4541
|
-
}
|
|
4542
|
-
} else {
|
|
4543
|
-
|
|
4544
|
-
EXITSTATUS = status;
|
|
4545
|
-
|
|
4546
|
-
exitRuntime();
|
|
4547
|
-
|
|
4548
|
-
if (Module['onExit']) Module['onExit'](status);
|
|
4549
|
-
|
|
4550
|
-
ABORT = true;
|
|
4551
|
-
}
|
|
4552
|
-
|
|
4553
|
-
quit_(status, new ExitStatus(status));
|
|
4554
|
-
}
|
|
4555
|
-
|
|
4556
|
-
if (Module['preInit']) {
|
|
4557
|
-
if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
|
|
4558
|
-
while (Module['preInit'].length > 0) {
|
|
4559
|
-
Module['preInit'].pop()();
|
|
4560
|
-
}
|
|
4561
|
-
}
|
|
4562
|
-
|
|
4563
|
-
noExitRuntime = true;
|
|
4564
|
-
|
|
4565
|
-
run();
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|