From 117d3a81a73f85255f9d831ad5c6c69b40fce5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 21 Nov 2024 17:29:34 +0800 Subject: [PATCH] don't handle `../?.lua` for now --- script/workspace/require-path.lua | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index c2274e52c..2523aee0a 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -98,28 +98,6 @@ function mt:getRequireResultByPath(path) end end - -- handle `../?.lua` - local parentCount = 0 - for _ = 1, 1000 do - if searcher:match '^%.%.[/\\]' then - parentCount = parentCount + 1 - searcher = searcher:sub(4) - else - break - end - end - if parentCount > 0 then - local parentPath = libraryPath - or (self.scp.uri and furi.decode(self.scp.uri)) - if parentPath then - local tail - for _ = 1, parentCount do - parentPath, tail = parentPath:match '^(.+)[/\\]([^/\\]*)$' - currentPath = tail .. '/' .. currentPath - end - end - end - repeat cutedPath = currentPath:sub(pos) head = currentPath:sub(1, pos - 1)