Verified Commit ab983734 authored by Camil Staps's avatar Camil Staps 🙂

Expect a base64-encoded string in jsDeserializeJSVal

parent dc27f152
Pipeline #43894 passed with stages
in 14 minutes and 55 seconds
......@@ -247,13 +247,22 @@ jsWrapFunWithResult :: !({!JSVal} *JSWorld -> *(JSVal, *JSWorld)) !JSVal !*JSWor
*/
wrapInitFunction :: !(JSVal *JSWorld -> *JSWorld) -> {!JSVal} -> *JSWorld -> *JSWorld
//* Serialize a graph for deserialization with `jsDeserializeGraph`.
/**
* Serialize a graph for deserialization with `jsDeserializeGraph`.
* The resulting string is base64-encoded.
*/
jsSerializeGraph :: a !PrelinkedInterpretationEnvironment -> String
//* Deserialize a graph that was serialized with `jsSerializeGraph`.
/**
* Deserialize a graph that was serialized with `jsSerializeGraph`.
* The argument string must be base64-encoded.
*/
jsDeserializeGraph :: !*String !*JSWorld -> *(!.a, !*JSWorld)
//* Like `jsDeserializeGraph`, but works on a String in the JavaScript world.
/**
* Like `jsDeserializeGraph`, but works on a string in the JavaScript world.
* The argument string must be base64-encoded.
*/
jsDeserializeJSVal :: !JSVal !*JSWorld -> *(!.a, !*JSWorld)
/**
......
......@@ -853,7 +853,7 @@ ABCInterpreter.interpreter_imports={
var string=me.get_clean_string (me.memory_array[asp/4],true);
if (ABC_DEBUG)
console.log ('deserialize',string);
me.memory_array[asp/4]=me.deserialize (eval (string));
me.memory_array[asp/4]=me.deserialize (atob (eval (string)));
return pc+16;
case 8: /* ABC.Interpreter.JavaScript: jsSerializeOnClient */
me.require_hp(2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment