From 7d94900ded8e2e5ce8ef8ee2687528531d8f2a97 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Mon, 7 Jan 2019 13:24:58 -0800 Subject: Massive renaming (#1855) Automated renaming according to https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329. --- src/js/binaryen.js-post.js | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'src/js/binaryen.js-post.js') diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index dadc94bd7..aa2e613ce 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -424,21 +424,35 @@ function wrapModule(module, self) { return Module['_BinaryenCallIndirect'](module, target, i32sToStack(operands), operands.length, strToStack(type)); }); }; - self['getLocal'] = self['get_local'] = function(index, type) { - return Module['_BinaryenGetLocal'](module, index, type); - }; - self['setLocal'] = self['set_local'] = self['set_local'] = function(index, value) { - return Module['_BinaryenSetLocal'](module, index, value); - }; - self['teeLocal'] = self['tee_local'] = function(index, value) { - return Module['_BinaryenTeeLocal'](module, index, value); - }; - self['getGlobal'] = self['get_global'] = function(name, type) { - return Module['_BinaryenGetGlobal'](module, strToStack(name), type); + + self['local'] = { + 'get': function(index, type) { + return Module['_BinaryenGetLocal'](module, index, type); + }, + 'set': function(index, value) { + return Module['_BinaryenSetLocal'](module, index, value); + }, + 'tee': function(index, value) { + return Module['_BinaryenTeeLocal'](module, index, value); + } } - self['setGlobal'] = self['set_global'] = function(name, value) { - return Module['_BinaryenSetGlobal'](module, strToStack(name), value); + + self['getLocal'] = self['local']['get']; + self['setLocal'] = self['local']['set']; + self['teeLocal'] = self['local']['tee']; + + self['global'] = { + 'get': function(name, type) { + return Module['_BinaryenGetGlobal'](module, strToStack(name), type); + }, + 'set': function(name, value) { + return Module['_BinaryenSetGlobal'](module, strToStack(name), value); + } } + + self['getGlobal'] = self['global']['get']; + self['setGlobal'] = self['global']['set']; + self['currentMemory'] = self['current_memory'] = function() { return Module['_BinaryenHost'](module, Module['CurrentMemory']); } -- cgit v1.2.3