This code works:
Promise.all([Promise.resolve(1)])
However, this code does not:
const f = Promise.all
f([Promise.resolve(1)])
The second piece of code throws the following error: Uncaught TypeError: Promise.all called on non-object.
Why can't I assign the function Promise.all to a variable and use it as normal?
Because that's what the spec requires.
1. Let C be the this value.
2. Let promiseCapability be ? NewPromiseCapability(C).
3. Let promiseResolve be Completion(GetPromiseResolve(C)).
...
The all function requires its this value to be a constructor function that supports the parameter conventions of the Promise constructor.
Your current code is not calling the function as part of an object (that is, f is a standalone identifier), so the resulting this is either the global object or undefined, depending on whether you're in strict mode or not - either way, the above requirement is not fulfilled.
If you bind the function to Promise, it'll work.
const f = Promise.all.bind(Promise);