From 581449d9928059dda1a51b9c1ab0fc43de5764e9 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Tue, 1 Oct 2019 17:13:43 -0700 Subject: [PATCH] Port more code over to use strict --- plugin/src/Assets.lua | 8 +++----- plugin/src/Theme.lua | 14 ++++---------- plugin/src/runTests.lua | 4 ---- 3 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 plugin/src/runTests.lua diff --git a/plugin/src/Assets.lua b/plugin/src/Assets.lua index 5c04bd8c..86b8500c 100644 --- a/plugin/src/Assets.lua +++ b/plugin/src/Assets.lua @@ -1,3 +1,5 @@ +local strict = require(script.Parent.strict) + local Assets = { Sprites = {}, Slices = { @@ -18,11 +20,7 @@ local Assets = { } local function guardForTypos(name, map) - setmetatable(map, { - __index = function(_, key) - error(("%q is not a valid member of %s"):format(tostring(key), name), 2) - end - }) + strict(name, map) for key, child in pairs(map) do if type(child) == "table" then diff --git a/plugin/src/Theme.lua b/plugin/src/Theme.lua index 9595efce..0307c287 100644 --- a/plugin/src/Theme.lua +++ b/plugin/src/Theme.lua @@ -1,4 +1,6 @@ -local Theme = { +local strict = require(script.Parent.strict) + +return strict("Theme", { ButtonFont = Enum.Font.GothamSemibold, InputFont = Enum.Font.Code, TitleFont = Enum.Font.GothamBold, @@ -9,12 +11,4 @@ local Theme = { PrimaryColor = Color3.fromRGB(64, 64, 64), SecondaryColor = Color3.fromRGB(235, 235, 235), LightTextColor = Color3.fromRGB(160, 160, 160), -} - -setmetatable(Theme, { - __index = function(_, key) - error(("%s is not a valid member of Theme"):format(key), 2) - end -}) - -return Theme \ No newline at end of file +}) \ No newline at end of file diff --git a/plugin/src/runTests.lua b/plugin/src/runTests.lua deleted file mode 100644 index 9b1da76e..00000000 --- a/plugin/src/runTests.lua +++ /dev/null @@ -1,4 +0,0 @@ -return function() - local TestEZ = require(script.Parent.Parent.TestEZ) - TestEZ.TestBootstrap:run(script.Parent) -end