From ca4427cf6d5cca874746f95dbbef898970730685 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Fri, 27 Dec 2013 15:57:01 -0800 Subject: [PATCH] add missing functions to default whitelist, sort it --- moonscript/cmd/lint.lua | 70 +++++++++++++++++++++------------------- moonscript/cmd/lint.moon | 70 +++++++++++++++++++++------------------- 2 files changed, 72 insertions(+), 68 deletions(-) diff --git a/moonscript/cmd/lint.lua b/moonscript/cmd/lint.lua index 9dbbcc5..a8c0890 100644 --- a/moonscript/cmd/lint.lua +++ b/moonscript/cmd/lint.lua @@ -14,43 +14,45 @@ do Block = _obj_0.Block end local default_whitelist = Set({ - 'loadstring', - 'select', - '_VERSION', - 'pcall', - 'package', - 'error', - 'rawget', - 'pairs', - 'xpcall', - 'rawlen', - 'io', - 'loadfile', - 'ipairs', - 'table', - 'require', - 'os', - 'module', - 'debug', - 'type', - 'getmetatable', - 'rawequal', - 'dofile', - 'unpack', - 'math', - 'load', - 'bit32', - 'string', - 'rawset', - 'tostring', - 'print', - 'assert', '_G', - 'next', - 'setmetatable', - 'tonumber', + '_VERSION', + 'assert', + 'bit32', 'collectgarbage', 'coroutine', + 'debug', + 'dofile', + 'error', + 'getfenv', + 'getmetatable', + 'io', + 'ipairs', + 'load', + 'loadfile', + 'loadstring', + 'math', + 'module', + 'next', + 'os', + 'package', + 'pairs', + 'pcall', + 'print', + 'rawequal', + 'rawget', + 'rawlen', + 'rawset', + 'require', + 'select', + 'setfenv', + 'setmetatable', + 'string', + 'table', + 'tonumber', + 'tostring', + 'type', + 'unpack', + 'xpcall', "nil", "true", "false" diff --git a/moonscript/cmd/lint.moon b/moonscript/cmd/lint.moon index 93730bc..4add665 100644 --- a/moonscript/cmd/lint.moon +++ b/moonscript/cmd/lint.moon @@ -5,43 +5,45 @@ import Block from require "moonscript.compile" -- globals allowed to be referenced default_whitelist = Set { - 'loadstring' - 'select' - '_VERSION' - 'pcall' - 'package' - 'error' - 'rawget' - 'pairs' - 'xpcall' - 'rawlen' - 'io' - 'loadfile' - 'ipairs' - 'table' - 'require' - 'os' - 'module' - 'debug' - 'type' - 'getmetatable' - 'rawequal' - 'dofile' - 'unpack' - 'math' - 'load' - 'bit32' - 'string' - 'rawset' - 'tostring' - 'print' - 'assert' '_G' - 'next' - 'setmetatable' - 'tonumber' + '_VERSION' + 'assert' + 'bit32' 'collectgarbage' 'coroutine' + 'debug' + 'dofile' + 'error' + 'getfenv' + 'getmetatable' + 'io' + 'ipairs' + 'load' + 'loadfile' + 'loadstring' + 'math' + 'module' + 'next' + 'os' + 'package' + 'pairs' + 'pcall' + 'print' + 'rawequal' + 'rawget' + 'rawlen' + 'rawset' + 'require' + 'select' + 'setfenv' + 'setmetatable' + 'string' + 'table' + 'tonumber' + 'tostring' + 'type' + 'unpack' + 'xpcall' "nil" "true"