File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -89,21 +89,6 @@ import {
8989import { ExtensionContext } from "../../extension/types.ts" ;
9090import { NotebookContext } from "../../render/notebook/notebook-types.ts" ;
9191
92- // we can't naively ld.cloneDeep everything
93- // because that destroys class instances
94- // with private members
95- //
96- // Currently, that's ProjectContext.
97- //
98- // TODO: Ideally, we shouldn't be copying the RenderContext at all.
99- export function copyRenderContext (
100- context : RenderContext ,
101- ) : RenderContext {
102- return {
103- ...ld . cloneDeep ( context ) ,
104- project : context . project ,
105- } ;
106- }
10792export async function resolveFormatsFromMetadata (
10893 metadata : Metadata ,
10994 input : string ,
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ import { outputRecipe } from "./output.ts";
4848
4949import { renderPandoc } from "./render.ts" ;
5050import { PandocRenderCompletion , RenderServices } from "./types.ts" ;
51- import { copyRenderContext , renderContexts } from "./render-contexts.ts" ;
51+ import { renderContexts } from "./render-contexts.ts" ;
5252import { renderProgress } from "./render-info.ts" ;
5353import {
5454 ExecutedFile ,
@@ -114,6 +114,7 @@ import {
114114} from "../../project/project-shared.ts" ;
115115import { NotebookContext } from "../../render/notebook/notebook-types.ts" ;
116116import { setExecuteEnvironment } from "../../execute/environment.ts" ;
117+ import { safeCloneDeep } from "../../core/safe-clone-deep.ts" ;
117118
118119export async function renderExecute (
119120 context : RenderContext ,
@@ -503,7 +504,7 @@ async function renderFileInternal(
503504
504505 for ( const format of Object . keys ( contexts ) ) {
505506 pushTiming ( "render-context" ) ;
506- const context = copyRenderContext ( contexts [ format ] ) ; // since we're going to mutate it...
507+ const context = safeCloneDeep ( contexts [ format ] ) ; // since we're going to mutate it...
507508
508509 // disquality some documents from server: shiny
509510 if ( isServerShiny ( context . format ) && context . project ) {
You can’t perform that action at this time.
0 commit comments