facebook/idx

Firefox nightly - idx fails to match TypeErrors

ArnaudRinquin opened this issue · 6 comments

TypeErrors in Firefox nightly do not pass the undefinedPattern and nullPattern tests.

It's easily reproducible:

  • Go to this JSFiddle
  • Open the Debugger and check Pause on exception
  • Observe that the error is rethrown while it should be handled on line 65.

Screenshot:

screen shot 2018-08-27 at 10 50 30

This is due to TypeErrors messages in Firefox nightly being different from regular Firefox, see the same example in regular Firefox:

screen shot 2018-08-27 at 10 59 59

kud commented

Ha! I'm not the only one!

I'm doing something like

const simpleQueryString = idx(rawQuery, _ => _.query.simple_query_string)

and I've got

TypeError: "_.query is undefined, can't access property "simple_query_string" of it"

only on firefox nightly (fresh profile or not), no trouble on firefox classic and chrome and canary.

Also happening on Firefox 63.0b2 (Developer edition). This basically renders this package entirely unusable.

Yeah well, I think the foundation of this package is a bit broken: it relies on the error messages which are far from being reliable.

We eventually decided not to use it.

kud commented

Same here. I liked the concept of the lib but how it's done, it's not possible to use it.

As mentioned in the README.md under “Babel Transform”:

The idx runtime function exists for the purpose of illustrating the expected behavior and is not meant to be executed. The idx function is used in conjunction with a Babel plugin that replaces it with better performing code.

The implementation of idx in this package is not meant to be executed anywhere.

kud commented

In this case, be more precise on the README maybe. Because having this information only in the babel section means if you don't have babel or don't want to use it via babel, you won't read this part.