Giter VIP home page Giter VIP logo

Comments (8)

Gozala avatar Gozala commented on May 18, 2024

Thanks @ckknight for pointing that out, I did not knew about that bug. Still as bound with in the bound function is only used for instanceof it will work as expected since both functions will have same prototype. Also I guess it's probably better and safe to remove var bound = entirely as it's not really necessary anyway. Also all other cases seem are fine as named functions are just saved as properties

from es5-shim.

ckknight avatar ckknight commented on May 18, 2024

The safest way is to either use the anonymous function expression or to use a proper function declaration. They're essentially equivalent (aside from the hoisting).

from es5-shim.

Gozala avatar Gozala commented on May 18, 2024

On Monday, 2011-03-28 at 09:25 , ckknight wrote:
The safest way is to either use the anonymous function expression or to use a proper function declaration. They're essentially equivalent (aside from the hoisting).

I believe my suggestion to remove var bound = would make a proper function declaration. Do you mean we need to do more then that ?

Reply to this email directly or view it on GitHub:
https://github.com/kriskowal/es5-shim/issues/12#comment_926812

from es5-shim.

ckknight avatar ckknight commented on May 18, 2024

Nope, just go with either var bound = function() { } or function bound() { }.

from es5-shim.

ckknight avatar ckknight commented on May 18, 2024

Apparently I accidentally closed this. This is still an issue.

from es5-shim.

michaelficarra avatar michaelficarra commented on May 18, 2024

I don't see how this is actually a problem. If it was var boundA = function boundB() { ... }, I could see an issue, but it's not broken the way it is. Still, I guess it's better to just change it.

from es5-shim.

ckknight avatar ckknight commented on May 18, 2024

It's minimally a memory leak in JScript (IE), since it creates two function instances rather than one.

from es5-shim.

Gozala avatar Gozala commented on May 18, 2024

Change above fixes this issue. closing!

from es5-shim.

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.