From ff431f01062ce74a730a701041602eaf6d9c5682 Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Wed, 31 Oct 2018 23:02:01 +0000 Subject: [PATCH] pastojs: fixed calling destructor after exception in constructor git-svn-id: trunk@40116 - --- utils/pas2js/dist/rtl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/pas2js/dist/rtl.js b/utils/pas2js/dist/rtl.js index 3acc589dad..c7f95380a5 100644 --- a/utils/pas2js/dist/rtl.js +++ b/utils/pas2js/dist/rtl.js @@ -279,8 +279,8 @@ var rtl = { o.AfterConstruction(); } catch($e){ // do not call BeforeDestruction - if (this.Destroy) this.Destroy(); - this.$final(); + if (o.Destroy) o.Destroy(); + o.$final(); throw $e; } return o; @@ -314,8 +314,8 @@ var rtl = { if (o.AfterConstruction) o.AfterConstruction(); } catch($e){ // do not call BeforeDestruction - if (this.Destroy) this.Destroy(); - if (this.$final) this.$final(); + if (o.Destroy) o.Destroy(); + if (o.$final) this.$final(); throw $e; } return o;