aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/common')
-rw-r--r--builtin/common/tests/misc_helpers_spec.lua1
-rw-r--r--builtin/common/tests/serialize_spec.lua1
-rw-r--r--builtin/common/tests/vector_spec.lua2
-rw-r--r--builtin/common/vector.lua6
4 files changed, 5 insertions, 5 deletions
diff --git a/builtin/common/tests/misc_helpers_spec.lua b/builtin/common/tests/misc_helpers_spec.lua
index b16987f0b..b11236860 100644
--- a/builtin/common/tests/misc_helpers_spec.lua
+++ b/builtin/common/tests/misc_helpers_spec.lua
@@ -1,4 +1,5 @@
_G.core = {}
+_G.vector = {metatable = {}}
dofile("builtin/common/vector.lua")
dofile("builtin/common/misc_helpers.lua")
diff --git a/builtin/common/tests/serialize_spec.lua b/builtin/common/tests/serialize_spec.lua
index e46b7dcc5..69b2b567c 100644
--- a/builtin/common/tests/serialize_spec.lua
+++ b/builtin/common/tests/serialize_spec.lua
@@ -1,4 +1,5 @@
_G.core = {}
+_G.vector = {metatable = {}}
_G.setfenv = require 'busted.compatibility'.setfenv
diff --git a/builtin/common/tests/vector_spec.lua b/builtin/common/tests/vector_spec.lua
index 2f72f3383..25880236b 100644
--- a/builtin/common/tests/vector_spec.lua
+++ b/builtin/common/tests/vector_spec.lua
@@ -1,4 +1,4 @@
-_G.vector = {}
+_G.vector = {metatable = {}}
dofile("builtin/common/vector.lua")
describe("vector", function()
diff --git a/builtin/common/vector.lua b/builtin/common/vector.lua
index 581d014e0..90010f6de 100644
--- a/builtin/common/vector.lua
+++ b/builtin/common/vector.lua
@@ -6,10 +6,8 @@ Note: The vector.*-functions must be able to accept old vectors that had no meta
-- localize functions
local setmetatable = setmetatable
-vector = {}
-
-local metatable = {}
-vector.metatable = metatable
+-- vector.metatable is set by C++.
+local metatable = vector.metatable
local xyz = {"x", "y", "z"}