Closed Bug 1437876 Opened 2 years ago Closed 2 years ago

Remove JS_ARRAY_LENGTH and JS_ARRAY_END

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: jorendorff, Assigned: jorendorff)

References

Details

Attachments

(1 file)

mozilla::ArrayLength() is better: it won't silently give a bogus answer if you pass it a non-array argument.

(Also, JS_ARRAY_LENGTH broke my patch, a capital offense. Really, "unified" builds are to blame, as usual, but since I can't murder them, JS_ARRAY_LENGTH gets it.)
mozilla::ArrayLength() is better: it won't silently give a bogus answer if you
pass it a non-array argument.
Attachment #8950624 - Flags: review?(jdemooij)
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
Blocks: 1429206
Comment on attachment 8950624 [details] [diff] [review]
Remove JS_ARRAY_LENGTH and JS_ARRAY_END

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

Good riddance.

::: js/src/gc/AllocKind.h
@@ +189,5 @@
>          FOR_EACH_ALLOCKIND(DEFINE_NURSERY_ALLOCABLE)
>  #undef DEFINE_NURSERY_ALLOCABLE
>      };
>  
> +    static_assert(MOZ_ARRAY_LENGTH(map) == size_t(AllocKind::LIMIT),

Nit: mozilla::ArrayLength here and below?
Attachment #8950624 - Flags: review?(jdemooij) → review+
D'oh. Thanks.
https://hg.mozilla.org/mozilla-central/rev/4d7a22f4a198
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.