diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-17 21:33:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-17 21:33:13 +0800 |
commit | 07e4b64f3a8439a9491cc7a277872e0a5d79a29b (patch) | |
tree | 6a2be087889003300ea1a17fcef7ce6ecf197c6b /lib/utils.js | |
parent | d3ce2bc9e73d9d98b34b261d282a18b9ce9d5880 (diff) | |
download | tracifyjs-07e4b64f3a8439a9491cc7a277872e0a5d79a29b.tar.gz tracifyjs-07e4b64f3a8439a9491cc7a277872e0a5d79a29b.zip |
fix `AST_Scope.clone()` (#2803)
fixes #2799
Diffstat (limited to 'lib/utils.js')
-rw-r--r-- | lib/utils.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js index dab7f566..9121fa93 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -303,6 +303,13 @@ Dictionary.prototype = { ret.push(f(this._values[i], i.substr(1))); return ret; }, + clone: function() { + var ret = new Dictionary(); + for (var i in this._values) + ret._values[i] = this._values[i]; + ret._size = this._size; + return ret; + }, toObject: function() { return this._values } }; Dictionary.fromObject = function(obj) { |