Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Nikolai Tillmann edited this page May 10, 2018 · 3 revisions

Internal slot $Name modified in a nested context. This is not yet supported.

This error would typically only occur in an optimized function when an internal slot, as specified by the JavaScript spec, gets mutated in a conditional context.

This error indicates that you have hit a limitation in Prepack. Try to rearrange your code to overcome the limitation, or feel free to file an issue on GitHub with a feature request that a particular named internal slot should be supported.

For example, the error is triggered by the following code:

let p = {};
function f(c) {
  let o = {};
  if (c) {
    o.__proto__ = p;
    throw o;
  }
}
__optimize(f);

Here, the __proto__ assignment modifies the $Prototype internal slot. Prepack may currently not be able to generate code when this happens in a conditionally nested block. To work around the issue, make the modification unconditional:

let p = {};
function f(c) {
  let o = {};
  o.__proto__ = p;
  if (c) {
    throw o;
  }
}
__optimize(f);