From 5817046eee7898ba2da185bc0bbb8545f6ad3a01 Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 14 Apr 2021 23:59:56 +0100 Subject: [PATCH] deprecate Engine.run alias replaced by Runner.run --- src/core/Engine.js | 3 ++- src/module/main.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/Engine.js b/src/core/Engine.js index 75b99da..a1c4d60 100644 --- a/src/core/Engine.js +++ b/src/core/Engine.js @@ -305,7 +305,8 @@ var Body = require('../body/Body'); }; /** - * An alias for `Runner.run`, see `Matter.Runner` for more information. + * A deprecated alias for `Runner.run`, use `Matter.Runner.run(engine)` instead and see `Matter.Runner` for more information. + * @deprecated use Matter.Runner.run(engine) instead * @method run * @param {engine} engine */ diff --git a/src/module/main.js b/src/module/main.js index 476a96e..869ce38 100644 --- a/src/module/main.js +++ b/src/module/main.js @@ -28,3 +28,7 @@ Matter.Svg = require('../geometry/Svg'); Matter.Vector = require('../geometry/Vector'); Matter.Vertices = require('../geometry/Vertices'); Matter.World = require('../body/World'); + +// temporary back compatibility +Matter.Engine.run = Matter.Runner.run; +Matter.Common.deprecated(Matter.Engine, 'run', 'Engine.run ➤ use Matter.Runner.run(engine) instead');