Closed Bug 638312 Opened 11 years ago Closed 11 years ago

JS_IsBuiltinEvalFunction and JS_IsBuiltinFunctionConstructor


(Core :: JavaScript Engine, enhancement)

Not set





(Reporter: Waldo, Assigned: Waldo)


(Whiteboard: fixed-in-tracemonkey)


(1 file)

Attached patch PatchSplinter Review
We friend-ify non-JS_ versions of these; they should just be part of the JSAPI.
Attachment #516471 - Flags: review?(gal)
Comment on attachment 516471 [details] [diff] [review]

Why IsAnyBuiltinEvalFunction but JS_IsBuiltinEvalFunction? Doesn't seem consistent. I would drop the Any.
Attachment #516471 - Flags: review?(gal) → review+
I'm adding a similar function shortly (this was actually part of that patch until I realized it'd be better in its own bug) which queries whether a value is the eval function for that other object's global, so "Any" makes the distinction between the two clearer, and hopefully prevents mistaken use of one instead of the other.
The parameterization doesn't allow for IsBuiltinEvalFunction to mean "for only this global object", so the Any is unnecessary. It reads awkwardly too. Plus it is overlong. How about penalizing the name of the function that does take a global instead? Then API and internal names line up.

I was going to "penalize" both.  If both are explicit, then neither can mislead or be accidentally used, as it seems to me a JSFunction*-taking version potentially could depending on what variables the developer needing something like it had available to him.  But I don't care enough to get in yet another argument right now, over this, so I changed it.
Whiteboard: fixed-in-tracemonkey
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.