Code Monkey home page Code Monkey logo

Comments (14)

 avatar commented on April 28, 2024

You can use the mobile build of Lo-Dash (lodash mobile). Its methods are inlined directly, rather than compiled at runtime.

from lodash.

floydwch avatar floydwch commented on April 28, 2024

Awesome! It works. :)

from lodash.

floydwch avatar floydwch commented on April 28, 2024

It would be nice to add a csp build option, which is more intuitive to use.

from lodash.

jdalton avatar jdalton commented on April 28, 2024

Related to issue: misoproject/dataset/issues/158.

from lodash.

jdalton avatar jdalton commented on April 28, 2024

@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.

floydwch avatar floydwch commented on April 28, 2024

@jdalton Nice!

from lodash.

ctalkington avatar ctalkington commented on April 28, 2024

@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.

jdalton avatar jdalton commented on April 28, 2024

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.

ctalkington avatar ctalkington commented on April 28, 2024

what a pain, seems to make things 10x more complicated than they need to be!

from lodash.

jdalton avatar jdalton commented on April 28, 2024

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.

ctalkington avatar ctalkington commented on April 28, 2024

@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.

jgable avatar jgable commented on April 28, 2024

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.

jdalton avatar jdalton commented on April 28, 2024

Oh whew, that's only an issue on the edge version :D

from lodash.

lock avatar lock commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.