1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:58:12 +00:00

LibJS: Remove declarations of some TODO()'d BigInt and Promise functions

In hindsight declaring these prematurely wasn't the greatest idea - that
just makes any script checking for their existence believe they'll work,
and what follows next is a crash of the js or WebContent process. If we
omit the declarations, a polyfill can be provided instead.

This also affects the test262, which tests these - instead of reporting
a bunch of assertion crash errors, we should simply report test failure
for 'not a function', which in turn makes it easier to spot any actual
bugs causing crashes.
This commit is contained in:
Linus Groh 2021-06-02 21:06:21 +01:00
parent 163d776df6
commit d1d1f4f251
2 changed files with 9 additions and 7 deletions

View file

@ -28,10 +28,11 @@ void PromiseConstructor::initialize(GlobalObject& global_object)
define_property(vm.names.length, Value(1));
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.all, all, 1, attr);
define_native_function(vm.names.allSettled, all_settled, 1, attr);
define_native_function(vm.names.any, any, 1, attr);
define_native_function(vm.names.race, race, 1, attr);
// TODO: Implement these functions below and uncomment this.
// define_native_function(vm.names.all, all, 1, attr);
// define_native_function(vm.names.allSettled, all_settled, 1, attr);
// define_native_function(vm.names.any, any, 1, attr);
// define_native_function(vm.names.race, race, 1, attr);
define_native_function(vm.names.reject, reject, 1, attr);
define_native_function(vm.names.resolve, resolve, 1, attr);
}