Comments (7)
facebook/regenerator#112 is also contributing to this problem.
from ast-types.
The ast-types
part of the problem is easy to fix by removing the deprecated function and not using depd
anymore.
With Regenerator, the risk is that minified code might rename GeneratorFunction
and thereby break regeneratorRuntime.isGeneratorFunction
.
I wonder if we could just throw if GeneratorFunction.name
is wrong, so people have to deal with the minification issue using uglifyjs --reserved-names GeneratorFunction
or something like that.
from ast-types.
@bolinfest with ast-types
v0.6.0 and regenerator
v0.7.0 I believe I've removed all the CSP violations that might be causing you problems, but please let me know if you observe otherwise!
from ast-types.
@benjamn Thanks for the quick work! Could you also bump the recast
dependency in regenerator
to 0.9.2 and then publish the new regenerator to npm?
from ast-types.
Also, yes, with local changes, things seem to be working, though I had an issue with the embedded runtime. Specifically, the way this
is passed in to the anonymous function and is assigned to global
and then defining regeneratorRuntime
on it doesn't seem to work out in Atom. I haven't dug into it, so I'm not sure why.
As a workaround, I changed the anonymous function like so:
var regeneratorRuntime = (function(
// existing body of the anonymous function...
// but this return statement at the end is new.
return runtime;
}).apply(this, [this, function GeneratorFunction(){}]);
Since I prepend this to the top of my file, regeneratorRuntime
is assuredly defined in the global environment. While I was there, I also got rid of the Function
-used-as-eval()
at the end of the file, as that was another source of pain for the CSP restriction.
from ast-types.
New Regenerator (0.7.1) is on NPM. The global
variable is gone now, so I think your workaround is no longer necessary?
from ast-types.
@benjamn Thanks! Everything seems to be working in Atom now. My only problem is running regenerator as part of the prepublish
step, but I'll file a separate issue for that.
from ast-types.
Related Issues (20)
- ASTPath<Function> is not assignable to parameter of type ASTNode
- ArrowFunctionExpression fails to check arrow functions without body and the type is also wrong HOT 3
- Decorator visitor can't work
- [Flow] did not recognize object of type "PropertyDefinition" HOT 3
- core.ts does not test whether BigInt exists HOT 4
- ast-types no longer published on npmjs.com? HOT 4
- npm install fails due to conflicting peer dependency
- `quote: 'single'` is broken in 0.15.2
- `b.functionExpression.from(functionDeclaration)` is failing on Windows HOT 1
- [Proposal] we should provide a function to build a fork with defs extracted from @babel/types HOT 4
- Jay-Jones-TOKEN_693697a3f04163a6e53f66fa9dbf0cd3e8a9d6face40e7e2483ff106fd22d9afeac596df74ae93d22dfcf4ee978cc6e2782983287695126f18c7ae1c64903e85e71e9fc814ac7d83bf74445e733a98db281d631362ddcc2c1a8228c379d98cbf447c28c9d8405c5ef7e68927f3bd926e722b5a7de234da85d3141bc7b185a1fe"/>true HOT 1
- No support for PrivateIdentifier? HOT 1
- node.extra for `RegExpLiteral` appears to produce the wrong value
- Can we add "TSSatisfiesExpression" to src/def/typescript.ts HOT 1
- ClassDeclaration type is missing decorators HOT 1
- Does `TSTypeParameter.name` need to be all of `IdentifierKind` types?
- Wrong structure of TSFunctionType node HOT 1
- partial visit HOT 1
- Missing catch binding breaks scope API
- TSTypeOperatorBuilder interface call signature should accept a typeAnnotation parameter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ast-types.