1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +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

@ -26,9 +26,10 @@ void BigIntConstructor::initialize(GlobalObject& global_object)
define_property(vm.names.prototype, global_object.bigint_prototype(), 0);
define_property(vm.names.length, Value(1), Attribute::Configurable);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(vm.names.asIntN, as_int_n, 2, attr);
define_native_function(vm.names.asUintN, as_uint_n, 2, attr);
// TODO: Implement these functions below and uncomment this.
// u8 attr = Attribute::Writable | Attribute::Configurable;
// define_native_function(vm.names.asIntN, as_int_n, 2, attr);
// define_native_function(vm.names.asUintN, as_uint_n, 2, attr);
}
BigIntConstructor::~BigIntConstructor()