Forráskód Böngészése

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.
Linus Groh 4 éve
szülő
commit
d1d1f4f251

+ 4 - 3
Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp

@@ -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()

+ 5 - 4
Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp

@@ -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);
 }