ladybird/Libraries/LibJS/Runtime
Linus Groh 7fb299fe46 LibJS: Clean up TypedArray constructors and prototypes
The current implementation is not entirely correct yet. Two classes have
been added:
- TypedArrayConstructor, which the various typed array constructors now
  inherit from. Calling or constructing this class (from JS, that is)
  directly is not possible, we might want to move this abstract class
  functionality to NativeFunction at a later point.
- TypedArrayPrototype, which the various typed array prototypes now have
  as their own prototype. This will be the place where most of the
  functionality is being shared.

Relevant parts from the spec:

22.2.1 The %TypedArray% Intrinsic Object
The %TypedArray% intrinsic object:
- is a constructor function object that all of the TypedArray
  constructor objects inherit from.
- along with its corresponding prototype object, provides common
  properties that are inherited by all TypedArray constructors and their
  instances.

22.2.2 Properties of the %TypedArray% Intrinsic Object
The %TypedArray% intrinsic object:
- has a [[Prototype]] internal slot whose value is %Function.prototype%.

22.2.2.3 %TypedArray%.prototype
The initial value of %TypedArray%.prototype is the %TypedArray%
prototype object.

22.2.6 Properties of the TypedArray Constructors
Each TypedArray constructor:
- has a [[Prototype]] internal slot whose value is %TypedArray%.

22.2.6.2 TypedArray.prototype
The initial value of TypedArray.prototype is the corresponding
TypedArray prototype intrinsic object (22.2.7).

22.2.7 Properties of the TypedArray Prototype Objects
Each TypedArray prototype object:
- has a [[Prototype]] internal slot whose value is %TypedArray.prototype%.

22.2.7.2 TypedArray.prototype.constructor
The initial value of a TypedArray.prototype.constructor is the
corresponding %TypedArray% intrinsic object.
2020-12-02 12:52:31 +01:00
..
Accessor.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Array.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
Array.h
ArrayConstructor.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
ArrayConstructor.h
ArrayIterator.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
ArrayIterator.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
ArrayIteratorPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
ArrayIteratorPrototype.h
ArrayPrototype.cpp LibJS: Handle circular references in Array.prototype.toLocaleString() 2020-11-06 15:50:18 +01:00
ArrayPrototype.h
BigInt.cpp LibJS: Remove a whole bunch of includes of <LibJS/Interpreter.h> 2020-09-27 20:26:58 +02:00
BigInt.h LibJS: Fix weird self-including header 2020-10-06 18:37:58 +02:00
BigIntConstructor.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
BigIntConstructor.h
BigIntObject.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
BigIntObject.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
BigIntPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
BigIntPrototype.h
BooleanConstructor.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
BooleanConstructor.h
BooleanObject.cpp LibJS: Remove a bunch of unnecessary uses of Cell::interpreter() 2020-09-27 20:26:58 +02:00
BooleanObject.h
BooleanPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
BooleanPrototype.h
BoundFunction.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
BoundFunction.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Cell.cpp LibJS: Remove Cell::interpreter() 2020-10-04 17:03:33 +02:00
Cell.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
CommonPropertyNames.h LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ConsoleObject.cpp LibJS: Add some more items to CommonPropertyNames that I missed 2020-10-14 00:10:49 +02:00
ConsoleObject.h
Date.cpp LibJS: Remove a whole bunch of includes of <LibJS/Interpreter.h> 2020-09-27 20:26:58 +02:00
Date.h LibJS: Use String::formatted() in various other places 2020-10-04 19:22:02 +02:00
DateConstructor.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
DateConstructor.h
DatePrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
DatePrototype.h
Error.cpp LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
Error.h LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ErrorConstructor.cpp LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ErrorConstructor.h LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ErrorPrototype.cpp LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ErrorPrototype.h LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ErrorTypes.cpp
ErrorTypes.h LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
Exception.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Exception.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Function.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Function.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
FunctionConstructor.cpp LibJS: Tweak generated source in 'new Function()' to match ES 2015 spec 2020-10-29 22:27:55 +01:00
FunctionConstructor.h
FunctionPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
FunctionPrototype.h
GlobalObject.cpp LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
GlobalObject.h LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
IndexedProperties.cpp LibJS: Skip trailing empty values in IndexedPropertyIterator 2020-11-07 10:03:58 +01:00
IndexedProperties.h LibJS: Use array-like size for IndexedProperties::is_empty() 2020-11-05 20:01:30 +01:00
IteratorOperations.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
IteratorOperations.h
IteratorPrototype.cpp LibJS: Remove a whole bunch of includes of <LibJS/Interpreter.h> 2020-09-27 20:26:58 +02:00
IteratorPrototype.h
JSONObject.cpp LibJS: Add some more items to CommonPropertyNames that I missed 2020-10-14 00:10:49 +02:00
JSONObject.h
LexicalEnvironment.cpp LibJS: Add a scope object abstraction 2020-11-28 17:16:48 +01:00
LexicalEnvironment.h LibJS: Add a scope object abstraction 2020-11-28 17:16:48 +01:00
MarkedValueList.cpp
MarkedValueList.h
MathObject.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
MathObject.h
NativeFunction.cpp LibJS: Move "strict mode" state to the call stack 2020-10-04 17:03:33 +02:00
NativeFunction.h LibJS: Move "strict mode" state to the call stack 2020-10-04 17:03:33 +02:00
NativeProperty.cpp
NativeProperty.h
NumberConstructor.cpp LibJS: Use pow instead of __bulitin_pow on clang 2020-11-07 10:09:55 +01:00
NumberConstructor.h
NumberObject.cpp LibJS: Remove a whole bunch of includes of <LibJS/Interpreter.h> 2020-09-27 20:26:58 +02:00
NumberObject.h
NumberPrototype.cpp LibJS: Add some more items to CommonPropertyNames that I missed 2020-10-14 00:10:49 +02:00
NumberPrototype.h
Object.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Object.h LibJS: Add six typed arrays (signed and unsigned 8/16/32-bit) 2020-12-01 21:05:25 +01:00
ObjectConstructor.cpp LibJS: Implement Object(value) constructor 2020-11-04 23:06:44 +01:00
ObjectConstructor.h
ObjectPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
ObjectPrototype.h
PrimitiveString.cpp LibJS: Give VM a cache of single-ASCII-character PrimitiveString 2020-10-22 17:48:12 +02:00
PrimitiveString.h
PropertyAttributes.cpp
PropertyAttributes.h
PropertyName.h LibJS: Don't create "valid" PropertyName from null string 2020-11-04 15:31:39 +01:00
ProxyConstructor.cpp LibJS: Remove ProxyPrototype 2020-12-01 09:54:37 +01:00
ProxyConstructor.h
ProxyObject.cpp LibJS: Remove ProxyPrototype 2020-12-01 09:54:37 +01:00
ProxyObject.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Reference.cpp LibJS: Handle symbol PropertyName in primitive assignment error 2020-11-12 11:40:29 +01:00
Reference.h LibJS: Reduce use of Interpreter in Reference 2020-09-29 16:45:39 +02:00
ReflectObject.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
ReflectObject.h
RegExpConstructor.cpp LibJS: Make RegExp() constructor spec-compliant 2020-11-28 01:20:11 +01:00
RegExpConstructor.h
RegExpObject.cpp LibJS: Hook up Regex<ECMA262> to RegExpObject and implement `test()' 2020-11-27 21:32:41 +01:00
RegExpObject.h LibJS: Hook up Regex<ECMA262> to RegExpObject and implement `test()' 2020-11-27 21:32:41 +01:00
RegExpPrototype.cpp LibJS: Use enumerator macros to define RegExp.prototype flag getters 2020-11-28 01:20:11 +01:00
RegExpPrototype.h LibJS: Use enumerator macros to define RegExp.prototype flag getters 2020-11-28 01:20:11 +01:00
ScopeObject.cpp LibJS: Add a scope object abstraction 2020-11-28 17:16:48 +01:00
ScopeObject.h LibJS: Add a scope object abstraction 2020-11-28 17:16:48 +01:00
ScriptFunction.cpp LibJS: Constructor function's "prototype" property should be writable 2020-11-29 19:49:27 +01:00
ScriptFunction.h LibJS: Add a scope object abstraction 2020-11-28 17:16:48 +01:00
Shape.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
Shape.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
StringConstructor.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
StringConstructor.h
StringIterator.cpp
StringIterator.h
StringIteratorPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
StringIteratorPrototype.h
StringObject.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
StringObject.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
StringOrSymbol.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
StringPrototype.cpp LibJS: Add a basic implementation of String.prototype.substr() 2020-11-29 20:29:49 +01:00
StringPrototype.h LibJS: Add a basic implementation of String.prototype.substr() 2020-11-29 20:29:49 +01:00
Symbol.cpp LibJS: Remove a whole bunch of includes of <LibJS/Interpreter.h> 2020-09-27 20:26:58 +02:00
Symbol.h LibJS: Use string::formatted() in to_string() functions 2020-10-04 19:22:02 +02:00
SymbolConstructor.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
SymbolConstructor.h
SymbolObject.cpp LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
SymbolObject.h LibJS: Rename Cell::visit_children() => Cell::visit_edges() 2020-11-28 17:16:48 +01:00
SymbolPrototype.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
SymbolPrototype.h
TypedArray.cpp LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
TypedArray.h LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
TypedArrayConstructor.cpp LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
TypedArrayConstructor.h LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
TypedArrayPrototype.cpp LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
TypedArrayPrototype.h LibJS: Clean up TypedArray constructors and prototypes 2020-12-02 12:52:31 +01:00
Uint8ClampedArray.cpp LibJS: Have Uint8ClampedArray delegate OOB accesses to JS::Object 2020-12-01 17:12:04 +01:00
Uint8ClampedArray.h
Value.cpp LibWeb+LibJS: Add [LegacyNullToEmptyString] attribute 2020-11-11 12:15:05 +01:00
Value.h LibJS: Make JS::Value constructors take const cell pointers 2020-11-28 17:16:48 +01:00
VM.cpp LibJS+LibWeb: Log JavaScript exceptions raised by web content 2020-11-29 16:50:32 +01:00
VM.h LibJS+LibWeb: Log JavaScript exceptions raised by web content 2020-11-29 16:50:32 +01:00
WithScope.cpp LibJS: Add basic support for "with" statements 2020-11-28 17:16:48 +01:00
WithScope.h LibJS: Run clang-format on WithScope.h 2020-11-28 17:36:38 +01:00