protected static LuaValue weaken(LuaValue value) {
		switch (value.type()) {
		case LuaValue.TFUNCTION:
		case LuaValue.TTHREAD:
		case LuaValue.TTABLE:
			return new WeakValue(value);
		case LuaValue.TUSERDATA:
			return new WeakUserdata(value);
		default:
			return value;
		}
	}