fix(language-service): don't require `reflect-metadata` module to be provided (#15569)
Fixes #15568
This commit is contained in:
parent
49162784a8
commit
331b9f6425
|
@ -49,13 +49,15 @@ function resolve(id, from) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var banner = `
|
var banner = `
|
||||||
|
var $reflect = {defineMetadata: function() {}, getOwnMetadata: function(){}};
|
||||||
|
((typeof global !== 'undefined' && global)||{})['Reflect'] = $reflect;
|
||||||
var $deferred, $resolved, $provided;
|
var $deferred, $resolved, $provided;
|
||||||
function $getModule(name) { return $provided[name] || require(name); }
|
function $getModule(name) { return $provided[name] || require(name); }
|
||||||
function define(modules, cb) { $deferred = { modules: modules, cb: cb }; }
|
function define(modules, cb) { $deferred = { modules: modules, cb: cb }; }
|
||||||
module.exports = function(provided) {
|
module.exports = function(provided) {
|
||||||
if ($resolved) return $resolved;
|
if ($resolved) return $resolved;
|
||||||
var result = {};
|
var result = {};
|
||||||
$provided = Object.assign({}, provided || {}, { exports: result });
|
$provided = Object.assign({'reflect-metadata': $reflect}, provided || {}, { exports: result });
|
||||||
$deferred.cb.apply(this, $deferred.modules.map($getModule));
|
$deferred.cb.apply(this, $deferred.modules.map($getModule));
|
||||||
$resolved = result;
|
$resolved = result;
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue