Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

polyfill assign for ie11 #8

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"url": "https://github.com/Microsoft/monaco-editor/issues"
},
"devDependencies": {
"monaco-editor-core": "0.16.0",
"monaco-editor-core": "^0.16.1",
"monaco-languages": "^1.7.0",
"monaco-plugin-helpers": "^1.0.2",
"requirejs": "^2.3.6",
Expand Down
31 changes: 31 additions & 0 deletions src/fillers/polyfills.ts
Original file line number Diff line number Diff line change
@@ -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
});
}
}
3 changes: 3 additions & 0 deletions src/htmlWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import Thenable = monaco.Thenable;
import * as htmlService from 'vscode-html-languageservice';
import * as ls from 'vscode-languageserver-types';

import * as poli from './fillers/polyfills';

poli.polyfill();

export class HTMLWorker {

Expand Down