Commit dc4a53ba authored by Jan de Mooij's avatar Jan de Mooij
Browse files

Bug 1825014 part 4 - Use a rest parameter instead of arguments for some...

Bug 1825014 part 4 - Use a rest parameter instead of arguments for some error-throwing functions. r=iain

This eliminates the remaining uses of `arguments` in self-hosted code.

These functions are called from C++ code. I'll see if we can remove them in a follow-up bug.

Depends on D173953

Differential Revision: https://phabricator.services.mozilla.com/D173954
parent 46e21d31
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -124,27 +124,27 @@ function SpeciesConstructor(obj, defaultConstructor) {
  );
}

function GetTypeError(msg) {
function GetTypeError(...args) {
  try {
    FUN_APPLY(ThrowTypeError, undefined, arguments);
    FUN_APPLY(ThrowTypeError, undefined, args);
  } catch (e) {
    return e;
  }
  assert(false, "the catch block should've returned from this function.");
}

function GetAggregateError(msg) {
function GetAggregateError(...args) {
  try {
    FUN_APPLY(ThrowAggregateError, undefined, arguments);
    FUN_APPLY(ThrowAggregateError, undefined, args);
  } catch (e) {
    return e;
  }
  assert(false, "the catch block should've returned from this function.");
}

function GetInternalError(msg) {
function GetInternalError(...args) {
  try {
    FUN_APPLY(ThrowInternalError, undefined, arguments);
    FUN_APPLY(ThrowInternalError, undefined, args);
  } catch (e) {
    return e;
  }