Closed Bug 1313392 Opened 8 years ago Closed 9 days ago

Consider decompiling bytecode to generate read-only errors.

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: emilio, Unassigned)

References

Details

(Keywords: triage-deferred)

Attachments

(1 file)

Spawned from bug 1304638, Nicolas suggested using the same mechanism to generate the normal error message.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1304638#c31
Whoops, filled the bug from the wrong template.
No longer blocks: stylo
Attached patch PatchSplinter Review
This was the patch from bug 1304638.
Attachment #8805159 - Flags: review?(jwalden+bmo)
See Also: → 1304638
Attachment #8805159 - Flags: review?(jwalden+bmo) → review?(nicolas.b.pierron)
Comment on attachment 8805159 [details] [diff] [review]
Patch

Review of attachment 8805159 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsapi.cpp
@@ +153,5 @@
> +static bool
> +LastFrameIsFunctionCall(JSContext* cx)
> +{
> +    FrameIter iter(cx);
> +    jsbytecode* pc = iter.pc();

"iter.pc()" is valid iff there is a frame.  These function call can be probably be made while using the jsapi, and this might trouble embedders to have either an assertion, or a crash on the next line.  Guard this with  "!iter.done()" condition.

@@ +154,5 @@
> +LastFrameIsFunctionCall(JSContext* cx)
> +{
> +    FrameIter iter(cx);
> +    jsbytecode* pc = iter.pc();
> +    return (JSOp)*pc == JSOP_FUNCALL;

This sounds incomplete, any reason why this only includes "fun.call(…)" and not "fun(…)" ?
Can you use "IsCallPC" function here?
Attachment #8805159 - Flags: review?(nicolas.b.pierron)
Keywords: triage-deferred
Priority: -- → P3
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 9 days ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: