Giter VIP home page Giter VIP logo

Comments (5)

pygy avatar pygy commented on May 31, 2024 1

It isn't mine either :-)

The goal is to improve ospec incrementally, since we won't port the Mithril test suite...

from ospec.

pygy avatar pygy commented on May 31, 2024

Edit: scratch that: I read your post too fast

from ospec.

pygy avatar pygy commented on May 31, 2024

Yes, I can reproduce it actually. Old JavaScriptCore (i.e. old WebKit, on which PhantomJS is built) version treat name and length as read-only properties on functions.

I don't think we should care about PhantomJS though, since the repro works fine in Safari 10+.

However, attempting to set fn.length in IE 11 also throws a similar error, even though fn.name can be overwritten. We could use eval or new Function to implement the spies, or wrap the part where we set the lenght in a try/catch block and ignore the error...

from ospec.

pygy avatar pygy commented on May 31, 2024

POC which passes the current tests and then some.

So, the POC as a gist works in Safari 8 and 9, and it works as well as it can in IE 11 (since fn.name is always undefined unless you set it manually, which is kind of pointless... edit: pointless except perhaps in transpiled code...).

Updated flems which detects the issue and only falls back on eval if needed.

from ospec.

dead-claudia avatar dead-claudia commented on May 31, 2024

Feel free to file a pull request. It's a pretty easy issue to resolve.

IME spies are usually the wrong thing to use anyways, but this isn't my framework.

from ospec.

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.