Explorar o código

Copy the contents before assigning the content

Steven Silvester %!s(int64=9) %!d(string=hai) anos
pai
achega
1bdb7df6c4
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/docmanager/index.ts

+ 4 - 1
src/docmanager/index.ts

@@ -8,6 +8,9 @@ import {
   IKernelSpecIds, ISessionId
 } from 'jupyter-js-services';
 
+import * as utils
+  from 'jupyter-js-utils';
+
 import {
   IDisposable, DisposableDelegate
 } from 'phosphor-disposable';
@@ -594,7 +597,7 @@ class DocumentManager implements IDisposable {
     }
     let lang = mFactoryEx.factory.preferredLanguage(path);
     let model = mFactoryEx.factory.createNew(lang);
-    let opts = mFactoryEx.contentsOptions;
+    let opts = utils.copy(mFactoryEx.contentsOptions);
     if (opts.format === 'json') {
       opts.content = model.toJSON();
     } else {