From 07602e2344e8653c0d1e71b807ec240a601834e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=B3=95=E9=91=AB?= Date: Fri, 18 Nov 2022 19:46:21 +0800 Subject: [PATCH] fix Render.create may case stack overflow deep clone engine object may case stack overflow --- src/render/Render.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/render/Render.js b/src/render/Render.js index ae52040e..1d08620a 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -90,7 +90,12 @@ var Mouse = require('../core/Mouse'); } }; - var render = Common.extend(defaults, options); + var render = Common.extend(defaults, { + ...options, + engine: undefined, + element: undefined, + canvas: undefined, + }); if (render.canvas) { render.canvas.width = render.options.width || render.canvas.width;