Giter Club home page Giter Club logo

scope-extensions-js's People

Contributors

dependabot[bot] avatar thedaviddelta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

scope-extensions-js's Issues

SyntaxError: Unexpected strict mode reserved word

Hi,

I am using this library in Angular code. Although it plays nicely in components, it breaks tests that are generated by Angular.

As an example this is what I get when running them :

Chrome Headless 103.0.5058.0 (Linux x86_64) ConfigurationComponent should create FAILED
        SyntaxError: Unexpected strict mode reserved word
        error properties: Object({ let: Function, also: Function, run: Function, apply: Function, takeIf: Function, takeUnless: Function })
        SyntaxError: Unexpected strict mode reserved word

The compiler seems to complain about one of the functions that may be already reserved in JS.

Any idea of a solution ?

Does not work well with react

React is complaining about the custom prototype functions (since React objects also inherit from Object).

As T.J. Crowder points out in a comment at stackoverflow one should extend prototypes this way

Object.defineProperty( Object.prototype, "let", { value(block) { return block(this!); }, configurable: true, writable: true } );

rather than

Object.prototype.let = function(this, block) { return block(this!); }

I have tested it locally, and it works wonders.

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.