Browse Source

pas2js: fixed arrayRef

mattias 5 years ago
parent
commit
a60bc1782b
1 changed files with 10 additions and 3 deletions
  1. 10 3
      compiler/utils/pas2js/dist/rtl.js

+ 10 - 3
compiler/utils/pas2js/dist/rtl.js

@@ -385,6 +385,15 @@ var rtl = {
     return null;
     return null;
   },
   },
 
 
+  hideProp: function(o,p,v){
+    Object.defineProperty(o,p, {
+      enumerable: false,
+      configurable: true,
+      writable: true
+    });
+    if(arguments.length>2){ o[p]=v; }
+  },
+
   recNewT: function(parent,name,initfn,full){
   recNewT: function(parent,name,initfn,full){
     // create new record type
     // create new record type
     var t = {};
     var t = {};
@@ -802,9 +811,7 @@ var rtl = {
   },
   },
 
 
   arrayRef: function(a){
   arrayRef: function(a){
-    if (a!=null){
-      rtl.hideProp(a,$pas2jsrefcnt,1);
-    }
+    if (a!=null) rtl.hideProp(a,'$pas2jsrefcnt',1);
     return a;
     return a;
   },
   },