Cleanup naming for scalar and typed array types

RESOLVED FIXED in mozilla33

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bhackett, Assigned: bhackett)

Tracking

unspecified
mozilla33
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Posted patch patchSplinter Review
There are currently two separate enums, ArrayBufferView::ViewType in jsfriendapi.h and ScalarTypeDescr::Type in TypedObject.h, which encode almost (but not quite) the same set of values for the various primitive scalar types like uint8, float32, and so forth.  There is no real consistency to how these enums are used in the engine, so we end up with cases where the enums are cast into each other, cast into and then back out of ints, mixed uses of the two enums within the same file, and so forth.  This is a mess.

The attached patch changes things so that there is a single new enum, Scalar::Type in jsfriendapi.h, which is used throughout the engine and by API clients.  I tried to be economical with the naming (e.g. Scalar::Int32 instead of ArrayBufferView::TYPE_INT32) and also removed all the casts of this enum into or out of primitive types which I could.
Attachment #8435881 - Flags: review?(sphink)
Depends on: 1037252
mcMerge absolutely refuses to comment to this bug.

Landed https://hg.mozilla.org/integration/mozilla-inbound/rev/4d482d201608
https://hg.mozilla.org/mozilla-central/rev/4d482d201608
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Attachment #8435881 - Flags: review?(sphink) → review+
Assignee: nobody → bhackett1024
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.