Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The minified build is broken #60

Open
evanw opened this issue Sep 26, 2019 · 1 comment
Open

The minified build is broken #60

evanw opened this issue Sep 26, 2019 · 1 comment

Comments

@evanw
Copy link

evanw commented Sep 26, 2019

Repro:

  1. Check out v1.1.2.
  2. Follow the instructions to build the shim.
  3. Create a html file containing this:
<body></body>
<script src="dist/realms-shim.umd.min.js"></script>
<script>Realm.makeRootRealm()</script>
  1. Open it.

Unexpected: Realm.makeRootRealm() crashes with ReferenceError: Z is not defined.

This is because the minifier is minifying the name globalEval in repairFunctions, which is then converted to a string and joined with a string that defines globalEval.

This is also a problem with v1.1.1 but not with v1.1.0.

jfparadis added a commit to jfparadis/realms-shim that referenced this issue Oct 1, 2019
Agoric#60
Use minimized UMD in demo.
jfparadis added a commit to jfparadis/realms-shim that referenced this issue Oct 1, 2019
Agoric#60
Use minimized UMD in demo.
jfparadis added a commit to jfparadis/realms-shim that referenced this issue Oct 1, 2019
Agoric#60
Changes:
- Keep cleanupSource for builds.
- Use minimized UMD in demo.
jfparadis added a commit that referenced this issue Oct 1, 2019
@warner
Copy link
Member

warner commented Oct 1, 2019

Should we enable CI for the new shim:test-integration command? Running npm run build && npm run shim:test-integration locally fails:

ok 8 new Real() should throws
# Realm.makeRootRealm()
ReferenceError: _315‍ is not defined
    at a (eval at createNewUnsafeRec (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:1:5968), <anonymous>:1)
    at repairFunctions (eval at createNewUnsafeRec (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:1:5968), <anonymous>:1)
    at eval (eval at createNewUnsafeRec (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:1:5968), <anonymous>:1)
    at eval (<anonymous>)
    at createNewUnsafeRec (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:1)
    at initRootRealm (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:9:3060)
    at c (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:1)
    at TamedFunction.makeRootRealm (/home/warner/bindmounts/trees/realms-shim/dist/realms-shim.esm.min.js:1)
    at Test.<anonymous> (/home/warner/bindmounts/trees/realms-shim/test-integration/realm.esm-min.test.js:13:19)
    at Test.bound [as _cb] (/home/warner/bindmounts/trees/realms-shim/node_modules/tape/lib/test.js:77:32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants