Current section
26 Versions
Jump to
Current section
26 Versions
Compare versions
4
files changed
+9
additions
-5
deletions
| @@ -2,7 +2,6 @@ | |
| 2 2 | |
| 3 3 | import Interpreter from "../interpreter.mjs"; |
| 4 4 | import Type from "../type.mjs"; |
| 5 | - import Utils from "../utils.mjs"; |
| 6 5 | |
| 7 6 | // IMPORTANT! |
| 8 7 | // If the given ported Erlang function calls other Erlang functions, then list such dependencies in the "Deps" comment (see :erlang./=/2 for an example). |
| @@ -182,7 +181,7 @@ const Erlang_Maps = { | |
| 182 181 | Interpreter.raiseBadMapError(map); |
| 183 182 | } |
| 184 183 | |
| 185 | - const newMap = Utils.shallowCloneObject(map); |
| 184 | + const newMap = Type.cloneMap(map); |
| 186 185 | newMap.data[Type.encodeMapKey(key)] = [key, value]; |
| 187 186 | |
| 188 187 | return newMap; |
| @@ -196,7 +195,7 @@ const Erlang_Maps = { | |
| 196 195 | Interpreter.raiseBadMapError(map); |
| 197 196 | } |
| 198 197 | |
| 199 | - const newMap = Utils.shallowCloneObject(map); |
| 198 | + const newMap = Type.cloneMap(map); |
| 200 199 | delete newMap.data[Type.encodeMapKey(key)]; |
| 201 200 | |
| 202 201 | return newMap; |
| @@ -5,6 +5,7 @@ import HologramInterpreterError from "./errors/interpreter_error.mjs"; | |
| 5 5 | import Interpreter from "./interpreter.mjs"; |
| 6 6 | import Sequence from "./sequence.mjs"; |
| 7 7 | import Serializer from "./serializer.mjs"; |
| 8 | + import Utils from "./utils.mjs"; |
| 8 9 | |
| 9 10 | export default class Type { |
| 10 11 | static actionStruct(data = {}) { |
| @@ -84,6 +85,10 @@ export default class Type { | |
| 84 85 | return Type.atom(value.toString()); |
| 85 86 | } |
| 86 87 | |
| 88 | + static cloneMap(map) { |
| 89 | + return {type: "map", data: Utils.shallowCloneObject(map.data)}; |
| 90 | + } |
| 91 | + |
| 87 92 | static commandStruct(data = {}) { |
| 88 93 | let {name, params, target} = data; |
| @@ -7,7 +7,7 @@ | |
| 7 7 | {<<"Sponsor">>,<<"https://github.com/sponsors/bartblast">>}, |
| 8 8 | {<<"Website">>,<<"https://hologram.page">>}]}. |
| 9 9 | {<<"name">>,<<"hologram">>}. |
| 10 | - {<<"version">>,<<"0.6.5">>}. |
| 10 | + {<<"version">>,<<"0.6.6">>}. |
| 11 11 | {<<"description">>, |
| 12 12 | <<"Full stack isomorphic Elixir web framework that can be used on top of Phoenix.">>}. |
| 13 13 | {<<"elixir">>,<<"~> 1.0">>}. |
| @@ -2,7 +2,7 @@ | |
| 2 2 | defmodule Hologram.MixProject do |
| 3 3 | use Mix.Project |
| 4 4 | |
| 5 | - @version "0.6.5" |
| 5 | + @version "0.6.6" |
| 6 6 | |
| 7 7 | # Copied from Hologram.Commons.SystemUtils |
| 8 8 | @windows_exec_suffixes [".bat", ".cmd", ".exe"] |