Closed Bug 1168474 Opened 9 years ago Closed 9 years ago

Remove assorted arity-checks that are easily done another way (or not at all)

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(1 file)

Various arity-tests that there's no reason to do, that are either entirely removable *or* should be converted into assertions or whatever.
Attached patch PatchSplinter Review
These removals are basically trivial.  Other arity uses will require more thought generally...I think.  But the end of the tunnel is definitely in sight, per acking.

The last FooNode with a test() method that tests arity is ListNode.  I'm not yet sure what I want to do about that -- we sort of still do want list-ful checking for that, or something.  Mega-kind assertion would be a little sad, but maybe I'll have a bright idea when I think on it harder.
Attachment #8610687 - Flags: review?(shu)
Comment on attachment 8610687 [details] [diff] [review]
Patch

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

::: js/src/frontend/NameFunctions.cpp
@@ +336,5 @@
>          RootedAtom prefix(cx, prefixArg);
>          if (cur == nullptr)
>              return true;
>  
> +        MOZ_ASSERT(cur->isKind(PNK_FUNCTION) == cur->isArity(PN_CODE));

Nit: I think it would read clearer to have MOZ_ASSERT(cur->isArity(PN_CODE)) in the if block below this.
Attachment #8610687 - Flags: review?(shu) → review+
https://hg.mozilla.org/mozilla-central/rev/a0781f78620a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: