ladybird/Libraries/LibJS/CMakeLists.txt

290 lines
9.6 KiB
Text
Raw Normal View History

set(SOURCES
2021-06-08 21:08:47 +00:00
AST.cpp
Bytecode/ASTCodegen.cpp
Bytecode/BasicBlock.cpp
Bytecode/Builtins.cpp
Bytecode/CodeGenerationError.cpp
Bytecode/Executable.cpp
2021-06-08 21:08:47 +00:00
Bytecode/Generator.cpp
Bytecode/IdentifierTable.cpp
2021-06-08 21:08:47 +00:00
Bytecode/Instruction.cpp
Bytecode/Interpreter.cpp
Bytecode/Label.cpp
Bytecode/RegexTable.cpp
Bytecode/ScopedOperand.cpp
Bytecode/StringTable.cpp
2021-06-08 21:08:47 +00:00
Console.cpp
Contrib/Test262/262Object.cpp
Contrib/Test262/AgentObject.cpp
Contrib/Test262/GlobalObject.cpp
Contrib/Test262/IsHTMLDDA.cpp
CyclicModule.cpp
2021-06-08 21:08:47 +00:00
Heap/BlockAllocator.cpp
Heap/Cell.cpp
Heap/CellImpl.cpp
Heap/CellAllocator.cpp
Heap/ConservativeVector.cpp
2021-06-08 21:08:47 +00:00
Heap/Handle.cpp
Heap/Heap.cpp
Heap/HeapBlock.cpp
Heap/MarkedVector.cpp
Heap/WeakContainer.cpp
2021-06-08 21:08:47 +00:00
Lexer.cpp
MarkupGenerator.cpp
Module.cpp
2021-06-08 21:08:47 +00:00
Parser.cpp
ParserError.cpp
Print.cpp
Runtime/AbstractOperations.cpp
Runtime/Accessor.cpp
Runtime/Agent.cpp
2021-06-11 17:06:20 +00:00
Runtime/AggregateError.cpp
Runtime/AggregateErrorConstructor.cpp
Runtime/AggregateErrorPrototype.cpp
Runtime/ArgumentsObject.cpp
2021-06-08 21:08:47 +00:00
Runtime/Array.cpp
Runtime/ArrayBuffer.cpp
Runtime/ArrayBufferConstructor.cpp
Runtime/ArrayBufferPrototype.cpp
Runtime/ArrayConstructor.cpp
Runtime/ArrayIterator.cpp
Runtime/ArrayIteratorPrototype.cpp
Runtime/ArrayPrototype.cpp
Runtime/AsyncFromSyncIterator.cpp
Runtime/AsyncFromSyncIteratorPrototype.cpp
Runtime/AsyncFunctionConstructor.cpp
Runtime/AsyncFunctionDriverWrapper.cpp
Runtime/AsyncFunctionPrototype.cpp
Runtime/AsyncGenerator.cpp
2021-11-15 00:53:24 +00:00
Runtime/AsyncGeneratorFunctionConstructor.cpp
Runtime/AsyncGeneratorFunctionPrototype.cpp
Runtime/AsyncGeneratorPrototype.cpp
2021-11-23 13:53:02 +00:00
Runtime/AsyncIteratorPrototype.cpp
Runtime/AtomicsObject.cpp
2021-06-08 21:08:47 +00:00
Runtime/BigInt.cpp
Runtime/BigIntConstructor.cpp
2020-06-06 00:14:10 +00:00
Runtime/BigIntObject.cpp
Runtime/BigIntPrototype.cpp
Runtime/BooleanConstructor.cpp
Runtime/BooleanObject.cpp
Runtime/BooleanPrototype.cpp
Runtime/BoundFunction.cpp
Runtime/Completion.cpp
Runtime/ConsoleObjectPrototype.cpp
Runtime/ConsoleObject.cpp
Runtime/DataView.cpp
Runtime/DataViewConstructor.cpp
Runtime/DataViewPrototype.cpp
Runtime/Date.cpp
Runtime/DateConstructor.cpp
Runtime/DatePrototype.cpp
Runtime/DeclarativeEnvironment.cpp
Runtime/DisposableStack.cpp
Runtime/DisposableStackConstructor.cpp
Runtime/DisposableStackPrototype.cpp
Runtime/ECMAScriptFunctionObject.cpp
Runtime/Environment.cpp
Runtime/Error.cpp
Runtime/ErrorConstructor.cpp
Runtime/ErrorPrototype.cpp
Runtime/ErrorTypes.cpp
Runtime/ExecutionContext.cpp
Runtime/FinalizationRegistry.cpp
Runtime/FinalizationRegistryConstructor.cpp
Runtime/FinalizationRegistryPrototype.cpp
Runtime/FunctionConstructor.cpp
Runtime/FunctionEnvironment.cpp
Runtime/FunctionObject.cpp
Runtime/FunctionPrototype.cpp
Runtime/GeneratorFunctionConstructor.cpp
Runtime/GeneratorFunctionPrototype.cpp
Runtime/GeneratorObject.cpp
Runtime/GeneratorPrototype.cpp
Runtime/GlobalEnvironment.cpp
Runtime/GlobalObject.cpp
Runtime/IndexedProperties.cpp
Runtime/Intl/AbstractOperations.cpp
Runtime/Intl/Collator.cpp
Runtime/Intl/CollatorCompareFunction.cpp
Runtime/Intl/CollatorConstructor.cpp
Runtime/Intl/CollatorPrototype.cpp
Runtime/Intl/DateTimeFormat.cpp
Runtime/Intl/DateTimeFormatConstructor.cpp
Runtime/Intl/DateTimeFormatFunction.cpp
Runtime/Intl/DateTimeFormatPrototype.cpp
Runtime/Intl/DisplayNames.cpp
Runtime/Intl/DisplayNamesConstructor.cpp
Runtime/Intl/DisplayNamesPrototype.cpp
Runtime/Intl/DurationFormat.cpp
Runtime/Intl/DurationFormatConstructor.cpp
Runtime/Intl/DurationFormatPrototype.cpp
Runtime/Intl/Intl.cpp
Runtime/Intl/ListFormat.cpp
Runtime/Intl/ListFormatConstructor.cpp
Runtime/Intl/ListFormatPrototype.cpp
Runtime/Intl/Locale.cpp
Runtime/Intl/LocaleConstructor.cpp
Runtime/Intl/LocalePrototype.cpp
Runtime/Intl/MathematicalValue.cpp
Runtime/Intl/NumberFormat.cpp
Runtime/Intl/NumberFormatConstructor.cpp
Runtime/Intl/NumberFormatFunction.cpp
Runtime/Intl/NumberFormatPrototype.cpp
Runtime/Intl/PluralRules.cpp
Runtime/Intl/PluralRulesConstructor.cpp
Runtime/Intl/PluralRulesPrototype.cpp
Runtime/Intl/RelativeTimeFormat.cpp
Runtime/Intl/RelativeTimeFormatConstructor.cpp
Runtime/Intl/RelativeTimeFormatPrototype.cpp
Runtime/Intl/Segmenter.cpp
Runtime/Intl/SegmenterConstructor.cpp
Runtime/Intl/SegmenterPrototype.cpp
Runtime/Intl/Segments.cpp
Runtime/Intl/SegmentIterator.cpp
Runtime/Intl/SegmentIteratorPrototype.cpp
Runtime/Intl/SegmentsPrototype.cpp
Runtime/Intrinsics.cpp
Runtime/Iterator.cpp
Runtime/IteratorConstructor.cpp
Runtime/IteratorHelper.cpp
Runtime/IteratorHelperPrototype.cpp
Runtime/IteratorPrototype.cpp
2020-06-10 18:01:00 +00:00
Runtime/JSONObject.cpp
Runtime/JobCallback.cpp
Runtime/KeyedCollections.cpp
2021-06-12 20:54:40 +00:00
Runtime/Map.cpp
Runtime/MapConstructor.cpp
Runtime/MapIterator.cpp
Runtime/MapIteratorPrototype.cpp
2021-06-12 20:54:40 +00:00
Runtime/MapPrototype.cpp
Runtime/MathObject.cpp
2022-01-16 22:30:15 +00:00
Runtime/ModuleEnvironment.cpp
Runtime/ModuleNamespaceObject.cpp
Runtime/NativeFunction.cpp
Runtime/NumberConstructor.cpp
Runtime/NumberObject.cpp
Runtime/NumberPrototype.cpp
Runtime/Object.cpp
Runtime/ObjectConstructor.cpp
Runtime/ObjectEnvironment.cpp
Runtime/ObjectPrototype.cpp
Runtime/PrimitiveString.cpp
2021-10-11 18:29:31 +00:00
Runtime/PrivateEnvironment.cpp
LibJS: Add initial support for Promises Almost a year after first working on this, it's finally done: an implementation of Promises for LibJS! :^) The core functionality is working and closely following the spec [1]. I mostly took the pseudo code and transformed it into C++ - if you read and understand it, you will know how the spec implements Promises; and if you read the spec first, the code will look very familiar. Implemented functions are: - Promise() constructor - Promise.prototype.then() - Promise.prototype.catch() - Promise.prototype.finally() - Promise.resolve() - Promise.reject() For the tests I added a new function to test-js's global object, runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs(). By design, queued jobs normally only run after the script was fully executed, making it improssible to test handlers in individual test() calls by default [2]. Subsequent commits include integrations into LibWeb and js(1) - pretty-printing, running queued promise jobs when necessary. This has an unusual amount of dbgln() statements, all hidden behind the PROMISE_DEBUG flag - I'm leaving them in for now as they've been very useful while debugging this, things can get quite complex with so many asynchronously executed functions. I've not extensively explored use of these APIs for promise-based functionality in LibWeb (fetch(), Notification.requestPermission() etc.), but we'll get there in due time. [1]: https://tc39.es/ecma262/#sec-promise-objects [2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
2021-04-01 20:13:29 +00:00
Runtime/Promise.cpp
Runtime/PromiseCapability.cpp
LibJS: Add initial support for Promises Almost a year after first working on this, it's finally done: an implementation of Promises for LibJS! :^) The core functionality is working and closely following the spec [1]. I mostly took the pseudo code and transformed it into C++ - if you read and understand it, you will know how the spec implements Promises; and if you read the spec first, the code will look very familiar. Implemented functions are: - Promise() constructor - Promise.prototype.then() - Promise.prototype.catch() - Promise.prototype.finally() - Promise.resolve() - Promise.reject() For the tests I added a new function to test-js's global object, runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs(). By design, queued jobs normally only run after the script was fully executed, making it improssible to test handlers in individual test() calls by default [2]. Subsequent commits include integrations into LibWeb and js(1) - pretty-printing, running queued promise jobs when necessary. This has an unusual amount of dbgln() statements, all hidden behind the PROMISE_DEBUG flag - I'm leaving them in for now as they've been very useful while debugging this, things can get quite complex with so many asynchronously executed functions. I've not extensively explored use of these APIs for promise-based functionality in LibWeb (fetch(), Notification.requestPermission() etc.), but we'll get there in due time. [1]: https://tc39.es/ecma262/#sec-promise-objects [2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
2021-04-01 20:13:29 +00:00
Runtime/PromiseConstructor.cpp
Runtime/PromiseJobs.cpp
Runtime/PromisePrototype.cpp
Runtime/PromiseReaction.cpp
Runtime/PromiseResolvingElementFunctions.cpp
LibJS: Add initial support for Promises Almost a year after first working on this, it's finally done: an implementation of Promises for LibJS! :^) The core functionality is working and closely following the spec [1]. I mostly took the pseudo code and transformed it into C++ - if you read and understand it, you will know how the spec implements Promises; and if you read the spec first, the code will look very familiar. Implemented functions are: - Promise() constructor - Promise.prototype.then() - Promise.prototype.catch() - Promise.prototype.finally() - Promise.resolve() - Promise.reject() For the tests I added a new function to test-js's global object, runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs(). By design, queued jobs normally only run after the script was fully executed, making it improssible to test handlers in individual test() calls by default [2]. Subsequent commits include integrations into LibWeb and js(1) - pretty-printing, running queued promise jobs when necessary. This has an unusual amount of dbgln() statements, all hidden behind the PROMISE_DEBUG flag - I'm leaving them in for now as they've been very useful while debugging this, things can get quite complex with so many asynchronously executed functions. I've not extensively explored use of these APIs for promise-based functionality in LibWeb (fetch(), Notification.requestPermission() etc.), but we'll get there in due time. [1]: https://tc39.es/ecma262/#sec-promise-objects [2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
2021-04-01 20:13:29 +00:00
Runtime/PromiseResolvingFunction.cpp
Runtime/PropertyDescriptor.cpp
Runtime/ProxyConstructor.cpp
Runtime/ProxyObject.cpp
Runtime/Realm.cpp
Runtime/Reference.cpp
Runtime/ReflectObject.cpp
Runtime/RegExpConstructor.cpp
Runtime/RegExpLegacyStaticProperties.cpp
Runtime/RegExpObject.cpp
Runtime/RegExpPrototype.cpp
Runtime/RegExpStringIterator.cpp
Runtime/RegExpStringIteratorPrototype.cpp
2021-06-08 21:08:47 +00:00
Runtime/Set.cpp
Runtime/SetConstructor.cpp
Runtime/SetIterator.cpp
Runtime/SetIteratorPrototype.cpp
2021-06-08 21:08:47 +00:00
Runtime/SetPrototype.cpp
Runtime/ShadowRealm.cpp
Runtime/ShadowRealmConstructor.cpp
Runtime/ShadowRealmPrototype.cpp
Runtime/Shape.cpp
Runtime/SharedArrayBufferConstructor.cpp
Runtime/SharedArrayBufferPrototype.cpp
Runtime/StringConstructor.cpp
2020-07-12 03:23:01 +00:00
Runtime/StringIterator.cpp
Runtime/StringIteratorPrototype.cpp
Runtime/StringObject.cpp
Runtime/StringPrototype.cpp
Runtime/SuppressedError.cpp
Runtime/SuppressedErrorConstructor.cpp
Runtime/SuppressedErrorPrototype.cpp
Runtime/Symbol.cpp
Runtime/SymbolConstructor.cpp
Runtime/SymbolObject.cpp
Runtime/SymbolPrototype.cpp
Runtime/Temporal/AbstractOperations.cpp
Runtime/Temporal/Calendar.cpp
Runtime/Temporal/CalendarConstructor.cpp
Runtime/Temporal/CalendarPrototype.cpp
Runtime/Temporal/Duration.cpp
Runtime/Temporal/DurationConstructor.cpp
Runtime/Temporal/DurationPrototype.cpp
Runtime/Temporal/Instant.cpp
Runtime/Temporal/InstantConstructor.cpp
Runtime/Temporal/InstantPrototype.cpp
Runtime/Temporal/ISO8601.cpp
Runtime/Temporal/Now.cpp
Runtime/Temporal/PlainDate.cpp
Runtime/Temporal/PlainDateConstructor.cpp
Runtime/Temporal/PlainDatePrototype.cpp
Runtime/Temporal/PlainDateTime.cpp
Runtime/Temporal/PlainDateTimeConstructor.cpp
Runtime/Temporal/PlainDateTimePrototype.cpp
Runtime/Temporal/PlainMonthDay.cpp
Runtime/Temporal/PlainMonthDayConstructor.cpp
Runtime/Temporal/PlainMonthDayPrototype.cpp
Runtime/Temporal/PlainTime.cpp
Runtime/Temporal/PlainTimeConstructor.cpp
Runtime/Temporal/PlainTimePrototype.cpp
Runtime/Temporal/PlainYearMonth.cpp
Runtime/Temporal/PlainYearMonthConstructor.cpp
Runtime/Temporal/PlainYearMonthPrototype.cpp
Runtime/Temporal/Temporal.cpp
Runtime/Temporal/TimeZone.cpp
Runtime/Temporal/TimeZoneConstructor.cpp
Runtime/Temporal/TimeZoneMethods.cpp
Runtime/Temporal/TimeZonePrototype.cpp
Runtime/Temporal/ZonedDateTime.cpp
Runtime/Temporal/ZonedDateTimeConstructor.cpp
Runtime/Temporal/ZonedDateTimePrototype.cpp
Runtime/TypedArray.cpp
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 00:23:40 +00:00
Runtime/TypedArrayConstructor.cpp
Runtime/TypedArrayPrototype.cpp
Runtime/Uint8Array.cpp
Runtime/Utf16String.cpp
Runtime/Value.cpp
Runtime/VM.cpp
2021-06-12 02:28:30 +00:00
Runtime/WeakMap.cpp
Runtime/WeakMapConstructor.cpp
Runtime/WeakMapPrototype.cpp
2021-06-12 14:38:34 +00:00
Runtime/WeakRef.cpp
Runtime/WeakRefConstructor.cpp
Runtime/WeakRefPrototype.cpp
2021-06-09 16:23:04 +00:00
Runtime/WeakSet.cpp
Runtime/WeakSetConstructor.cpp
Runtime/WeakSetPrototype.cpp
Runtime/WrapForValidIteratorPrototype.cpp
Runtime/WrappedFunction.cpp
Script.cpp
SourceCode.cpp
SourceTextModule.cpp
SyntaxHighlighter.cpp
SyntheticModule.cpp
Token.cpp
)
serenity_lib(LibJS js)
target_link_libraries(LibJS PRIVATE LibCore LibCrypto LibFileSystem LibRegex LibSyntax)
# Link LibUnicode publicly to ensure ICU data (which is in libicudata.a) is available in any process using LibJS.
target_link_libraries(LibJS PUBLIC LibUnicode)
# TODO: This is probably also needed on RISC-V.
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i.86.*")
target_link_libraries(LibJS PRIVATE atomic)
endif()
target_compile_options(LibJS PRIVATE -fno-omit-frame-pointer)
target_link_libraries(LibJS PUBLIC JSClangPlugin)