Skip to content

Import 'symbol-observable' before all other imports in extension host worker

Administrator requested to merge fix/1243-symbol-observable into master

Created by: lguychard

Fixes #1243

The ponyfill symbol-observable is impure. Since extensions are loaded through importScripts in a common web worker, if one of our extensions depends on symbol-observable, it may break other extensions.

As a result, if lang-typescript is the only extension loaded, it works fine, but if you sideload the following "extension":

import 'symbol-observable'

export function activate(): void {
    // noop
}

lang-typescript breaks with You provided an invalid object where a stream was expected (#1243).

Importing symbol-observable when starting the web worker fixes this by ensuring that the mutation of Symbol.observable happens before any extensions are loaded.

Merge request reports

Loading