Comments (14)
You can use the mobile build of Lo-Dash (lodash mobile
). Its methods are inlined directly, rather than compiled at runtime.
from lodash.
Awesome! It works. :)
from lodash.
It would be nice to add a csp
build option, which is more intuitive to use.
from lodash.
Related to issue: misoproject/dataset/issues/158.
from lodash.
@floydsoft I've added a csp
build, alias of mobile
, here. It will be documented in the next version bump (0.5.0), this week.
from lodash.
@jdalton Nice!
from lodash.
@jdalton are you sure sure that the changes actually resolve the issue? getting an issue still in my popup.
http://share.talkingtontech.com/2012-08-17_0814.png
from lodash.
The csp
/mobile
build inlines the templates used to create various methods but does not prevent you from using _.template
in your own script which would continue to cause the error. See this comment here:
Note: For Chrome extensions use the
lodash csp
build and see
http://code.google.com/chrome/extensions/trunk/sandboxingEval.html
for a workaround and lemme know if that solves your issue.
from lodash.
what a pain, seems to make things 10x more complicated than they need to be!
from lodash.
what a pain, seems to make things 10x more complicated than they need to be!
Yap, it's a lame hoop to jump through, but something you would have to do using Underscore or any other lib that uses Function
to generate their templates. BTW using the sandbox the normal Lo-Dash build should work ;D
from lodash.
@jdalton thanks for the input. I don't really care for all this CSP junk but guess I'll have to find a way to live with it!
from lodash.
I'm still seeing this problem in a mobile build and I think I've narrowed it down to the isJSC
variable around line 175 of lodash.js.
I'm experimenting with some solutions and have come up with this:
/** Detect various environments */
var isIeOpera = !!context.attachEvent,
isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
// On it's own line so it can be removed.
var isJSC = !/\n{2,}/.test(Function());
Also, in removeKeysOptimization adding a removeVar
since isJSC is only referenced in the assignment to isKeysFast
.
source = removeVar(source, "isJSC");
I'm working on a PR now, just making sure my npm test
works.
from lodash.
Oh whew, that's only an issue on the edge version :D
from lodash.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from lodash.
Related Issues (20)
- Type of parameter object is string in function baseGet(object, path)
- cloneDeep not cloning nested Map
- Method `sumBy` returns string HOT 2
- _.isEqual() returns false when array elements order is changed HOT 6
- Merge mutates source object if nested property is a class instance
- Future compatibility with Node.js/npm HOT 1
- Allow Default Value for toNumber("problem", 0) HOT 8
- isBuffer from lodash-es doesn't work HOT 1
- curryRight is broken in list.map context HOT 1
- Avoiding Lodash version disclosure HOT 1
- multiple vulnerabilities that exist in lodash.findlast HOT 4
- Attempt structuredClone in cloneDeep before doing manual clone HOT 4
- _.trimStart not work with "/" char
- _.kebabCase and _.camelCase treat some digits as delimiters but not others HOT 1
- async attempt
- lodash-es outdated HOT 1
- feature request: Safe maths functions HOT 6
- Alias `_.tail` to `_.last` HOT 2
- _.deburr() - ț not convert to t HOT 3
- Typescript error HOT 7
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 lodash.