WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Let JSVAL_IS_OBJECT only check for objects, not null

Let JSVAL_IS_OBJECT only check for objects, not null

by Tom Schuster :: Rate this Message:

| View in Thread

Hello!

I was looking into removing any use of JSVAL_IS_OBJECT from the
mozilla codebase. Turns out that this function would really win in
usefulness if it wouldn't return true for |null|. So I am proposing to
do that, let JSVAL_IS_OBJECT do what it says, return true _only_ for
JSObjects. Furthermore I propose that JSVAL_TO_OBJECT also only
returns objects and not null, thus probably getting rid of a lot of
null checks.

This way we could also get rid of the terrible !JSVAL_IS_PRIMITIVE
anti-pattern. We use these functions quite a few times and I would
think embedders do that too.

So my question is how useful feasible is this?

~Tom
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

 « Return to Thread: Let JSVAL_IS_OBJECT only check for objects, not null