From 9f43d27b4377b1d3e166657a608dad91668c7909 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 24 May 2017 14:00:00 +1000 Subject: src/ltable.js: Use a valid weakmap key for lightuserdata object hash --- src/ltable.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ltable.js b/src/ltable.js index b408cd1..df2d4f7 100644 --- a/src/ltable.js +++ b/src/ltable.js @@ -15,7 +15,9 @@ let lightuserdata_hashes = new WeakMap(); const get_lightuserdata_hash = function(v) { let hash = lightuserdata_hashes.get(v); if (!hash) { - hash = Symbol("lightuserdata"); + /* Hash should be something unique that is a valid WeakMap key + so that it ends up in dead_weak when removed from a table */ + hash = {}; lightuserdata_hashes.set(v, hash); } return hash; -- cgit v1.2.3-70-g09d2