From 0c009afbc73804259e1da0cf2b7a6a69ca728cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 29 May 2020 18:14:10 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/vm/getLibrary.lua | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'script-beta/vm/getLibrary.lua') diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua index ac6402de..8088917a 100644 --- a/script-beta/vm/getLibrary.lua +++ b/script-beta/vm/getLibrary.lua @@ -6,11 +6,10 @@ local function checkStdLibrary(source) if source.library then return source end - local globalName = vm.getGlobal(source) - if not globalName then + local name = guide.getName(source) + if not name then return nil end - local name = globalName:match '^s|(.+)$' if library.global[name] then return library.global[name] end @@ -30,12 +29,8 @@ end local function getNodeAsTable(source) local node = source.node - local nodeGlobalName = vm.getGlobal(node) - if not nodeGlobalName then - return nil - end - local nodeName = nodeGlobalName:match '^s|(.+)$' - return getLibInNode(source, library.global[nodeName]) + local name = guide.getName(node) + return getLibInNode(source, library.global[name]) end local function getNodeAsObject(source) -- cgit v1.2.3