Commit b2105324 authored by Steffen Michels's avatar Steffen Michels

Revert "Merge branch '327-copying-utf-8-strings-from-javascript' into 'master'"

This reverts merge request !301
parent d606eaf3
Pipeline #27973 passed with stage
in 5 minutes and 13 seconds
...@@ -8,8 +8,6 @@ const ABC_loading_promise=ABCInterpreter.instantiate({ ...@@ -8,8 +8,6 @@ const ABC_loading_promise=ABCInterpreter.instantiate({
heap_size: 8<<20, heap_size: 8<<20,
stack_size: 512<<10, stack_size: 512<<10,
encoding: 'utf-8',
util_imports: { util_imports: {
has_host_reference: function (index) { has_host_reference: function (index) {
if (index>=ABC.shared_clean_values.length) if (index>=ABC.shared_clean_values.length)
...@@ -31,8 +29,8 @@ const ABC_loading_promise=ABCInterpreter.instantiate({ ...@@ -31,8 +29,8 @@ const ABC_loading_promise=ABCInterpreter.instantiate({
case 0: /* evaluation finished */ case 0: /* evaluation finished */
return 0; return 0;
case 1: /* iTasks.UI.JS.Interface: set_js */ case 1: /* iTasks.UI.JS.Interface: set_js */
var v=ABC.get_clean_string(ABC.memory_array[asp/4], true); var v=ABC.get_clean_string(ABC.memory_array[asp/4], true, 'utf-8');
var x=ABC.get_clean_string(ABC.memory_array[asp/4-2], true); var x=ABC.get_clean_string(ABC.memory_array[asp/4-2], true, 'utf-8');
if (ABC_DEBUG) if (ABC_DEBUG)
console.log(v,'.=',x); console.log(v,'.=',x);
try { try {
...@@ -46,13 +44,13 @@ const ABC_loading_promise=ABCInterpreter.instantiate({ ...@@ -46,13 +44,13 @@ const ABC_loading_promise=ABCInterpreter.instantiate({
Function(v+'='+x)(); Function(v+'='+x)();
break; break;
case 2: /* iTasks.UI.JS.Interface: eval_js */ case 2: /* iTasks.UI.JS.Interface: eval_js */
var string=ABC.get_clean_string(ABC.memory_array[asp/4], true); var string=ABC.get_clean_string(ABC.memory_array[asp/4], true, 'utf-8');
if (ABC_DEBUG) if (ABC_DEBUG)
console.log('eval',string); console.log('eval',string);
Function(string)(); Function(string)();
break; break;
case 3: /* iTasks.UI.JS.Interface: eval_js_with_return_value */ case 3: /* iTasks.UI.JS.Interface: eval_js_with_return_value */
var string=ABC.get_clean_string(ABC.memory_array[asp/4], true); var string=ABC.get_clean_string(ABC.memory_array[asp/4], true, 'utf-8');
if (ABC_DEBUG) if (ABC_DEBUG)
console.log('eval',string); console.log('eval',string);
var result=eval('('+string+')'); // the parentheses are needed for {}, for instance var result=eval('('+string+')'); // the parentheses are needed for {}, for instance
...@@ -88,7 +86,7 @@ const ABC_loading_promise=ABCInterpreter.instantiate({ ...@@ -88,7 +86,7 @@ const ABC_loading_promise=ABCInterpreter.instantiate({
ABC.initialized=true; ABC.initialized=true;
break; break;
case 10: /* iTasks.UI.JS.Interface: add CSS */ case 10: /* iTasks.UI.JS.Interface: add CSS */
var url=ABC.get_clean_string(ABC.memory_array[asp/4], false); var url=ABC.get_clean_string(ABC.memory_array[asp/4], false, 'utf-8');
var css=document.createElement('link'); var css=document.createElement('link');
css.rel='stylesheet'; css.rel='stylesheet';
css.type='text/css'; css.type='text/css';
...@@ -97,8 +95,8 @@ const ABC_loading_promise=ABCInterpreter.instantiate({ ...@@ -97,8 +95,8 @@ const ABC_loading_promise=ABCInterpreter.instantiate({
document.head.appendChild(css); document.head.appendChild(css);
break; break;
case 11: /* iTasks.UI.JS.Interface: add JS */ case 11: /* iTasks.UI.JS.Interface: add JS */
var url=ABC.get_clean_string(ABC.memory_array[asp/4], false); var url=ABC.get_clean_string(ABC.memory_array[asp/4], false, 'utf-8');
var callback=ABC.get_clean_string(ABC.memory_array[asp/4-2], true); var callback=ABC.get_clean_string(ABC.memory_array[asp/4-2], true, 'utf-8');
var js=document.createElement('script'); var js=document.createElement('script');
js.type='text/javascript'; js.type='text/javascript';
js.async=false; js.async=false;
......
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