vigneshshanmugam / elements-kinds Goto Github PK
View Code? Open in Web Editor NEWJS helper function to debug elements kinds in v8
License: MIT License
JS helper function to debug elements kinds in v8
License: MIT License
isSMI
currently uses Number.isMaxSafeInteger
which goes all the way to 2**53-1
:
Lines 10 to 12 in 2d96ef5
However, the actual Smi range is Signed31 on 32-bit architectures and Signed32 on 64-bit architectures. Since the last bit is used to distinguish positive and negative numbers, that leaves 30 or 31 bits for the actual numeric value, respectively.
On my machine (64-bit):
%DebugPrint([2**31-1]);
// → PACKED_SMI_ELEMENTS
%DebugPrint([2**31]);
// → PACKED_DOUBLE_ELEMENTS
The current containsHoles
implementation seems to check for undefined
values:
Lines 25 to 32 in 2d96ef5
Holes are something else, though!
[undefined, undefined, undefined]
is a packed array that happens to contain undefined
values.[1,,2]
, x = [1, 2, 3]; delete x[1]
, new Array(10)
, and x = []; x[42] = 1
.You can detect holes by using the in
operator, or by using hasOwnProperty
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.