mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
polyfill assign
This commit is contained in:
parent
7df6821309
commit
1702ca1c07
4 changed files with 38 additions and 4 deletions
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -11,9 +11,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-editor-core": {
|
"monaco-editor-core": {
|
||||||
"version": "0.16.0",
|
"version": "0.16.1",
|
||||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.16.1.tgz",
|
||||||
"integrity": "sha512-8tm8vq0SVuQ+VXZFtPIEIronK3102SYCWe8wviWu/5TV4zlDQcf4YdzI6A4CrNqbUc46dD0ngijaKWoRSViI8g==",
|
"integrity": "sha512-nydAuVbU3B1T/sNz4ZiO+92HUnLyVE4YQWr91R8WDEBItFZuwPs7Z2VaCTgouU6BwNrSnDdK/kAyhKgpih+GHQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-languages": {
|
"monaco-languages": {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"url": "https://github.com/Microsoft/monaco-editor/issues"
|
"url": "https://github.com/Microsoft/monaco-editor/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"monaco-editor-core": "0.16.0",
|
"monaco-editor-core": "^0.16.1",
|
||||||
"monaco-languages": "^1.7.0",
|
"monaco-languages": "^1.7.0",
|
||||||
"monaco-plugin-helpers": "^1.0.2",
|
"monaco-plugin-helpers": "^1.0.2",
|
||||||
"requirejs": "^2.3.6",
|
"requirejs": "^2.3.6",
|
||||||
|
|
|
||||||
31
src/fillers/polyfills.ts
Normal file
31
src/fillers/polyfills.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
export function polyfill() {
|
||||||
|
|
||||||
|
// Object.assign, for IE11
|
||||||
|
if (typeof Object['assign'] != 'function') {
|
||||||
|
Object.defineProperty(Object, "assign", {
|
||||||
|
value: function assign(destination, sources) {
|
||||||
|
'use strict';
|
||||||
|
if (destination !== null) {
|
||||||
|
for (let i = 1; i < arguments.length; i++) {
|
||||||
|
const source = arguments[i];
|
||||||
|
if (source) {
|
||||||
|
for (var key in source) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||||
|
destination[key] = source[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return destination;
|
||||||
|
},
|
||||||
|
writable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,6 +11,9 @@ import Thenable = monaco.Thenable;
|
||||||
import * as htmlService from 'vscode-html-languageservice';
|
import * as htmlService from 'vscode-html-languageservice';
|
||||||
import * as ls from 'vscode-languageserver-types';
|
import * as ls from 'vscode-languageserver-types';
|
||||||
|
|
||||||
|
import * as poli from './fillers/polyfills';
|
||||||
|
|
||||||
|
poli.polyfill();
|
||||||
|
|
||||||
export class HTMLWorker {
|
export class HTMLWorker {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue