Git Product home page Git Product logo

Comments (3)

TomFrost avatar TomFrost commented on September 17, 2024

Hi Winston! I apologize for responding so late on this. I've been chewing on it ever since you posted it, and I keep arriving at this making the most sense as a constructor option that allows the programmer to enable JS-native functionality on throwing when a property of undefined is accessed.

I'm not in love the idea of using null vs undefined, because ultimately either of those things could be legitimate values inside the context. If Jexl threw an exception, that would make the difference quite clear -- at the expense of the programmer needing to catch the error if they enable this mode.

What do you think?

from jexl.

winstonewert avatar winstonewert commented on September 17, 2024

Hi! Yes, getting an exception would be good, especially if that exception can contain more information. If my expression was "foo.bar[12].gates.yellow", it'd be nice if the exception could indicate where exactly the undefined was.

from jexl.

Bob-Coding avatar Bob-Coding commented on September 17, 2024

Hi Tom, I'm having the same issue when comparing "null == undefined" or "null != undefined", both return back as undefined and will be true when comparing equality, when making a custom operator with using typeof undefined or typeof null both return a string "undefined", but typeof null should actually return a string "object" here instead of "undefined". This should resolve the issue.

from jexl.

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.