mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use number type for bitfields
Unions don't enumerate all the possible combinations of bitfields. I'm not actually sure why this was type-checking before. number doesn't provide much safety but it's more correct.
This commit is contained in:
1 parent
f69748601d
commit
488b973d68
2 files changed
+10
-10
No files matched your search
@@ -12,7 +12,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
export type TypeOfInternalContext = 0 | 1;
|
||||
export type TypeOfInternalContext = number;
|
||||
|
||||
module.exports = {
|
||||
NoContext: 0,
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
export type TypeOfSideEffect = 0 | 1 | 2 | 3 | 4 | 8 | 16 | 32 | 64;
|
||||
export type TypeOfSideEffect = number;
|
||||
|
||||
module.exports = {
|
||||
NoEffect: 0, // 0b0000000
|
||||
Placement: 1, // 0b0000001
|
||||
Update: 2, // 0b0000010
|
||||
NoEffect: 0, // 0b0000000
|
||||
Placement: 1, // 0b0000001
|
||||
Update: 2, // 0b0000010
|
||||
PlacementAndUpdate: 3, // 0b0000011
|
||||
Deletion: 4, // 0b0000100
|
||||
ContentReset: 8, // 0b0001000
|
||||
Callback: 16, // 0b0010000
|
||||
Err: 32, // 0b0100000
|
||||
Ref: 64, // 0b1000000
|
||||
Deletion: 4, // 0b0000100
|
||||
ContentReset: 8, // 0b0001000
|
||||
Callback: 16, // 0b0010000
|
||||
Err: 32, // 0b0100000
|
||||
Ref: 64, // 0b1000000
|
||||
};
|
||||
Reference in new issue
Block a user