From b6d81ccf6e63b26f5441ab22683e29b0d5c55252 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Tue, 6 Feb 2024 12:42:21 +0000 Subject: [PATCH] PlatformSeparator fix --- lib/src/stdlib/package_lib.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/src/stdlib/package_lib.dart b/lib/src/stdlib/package_lib.dart index a9f2d9f..5f5771e 100644 --- a/lib/src/stdlib/package_lib.dart +++ b/lib/src/stdlib/package_lib.dart @@ -18,7 +18,20 @@ const lua_exec_dir = "!"; const lua_igmark = "-"; class PackageLib { - static final lua_dirsep = Platform.pathSeparator; + static get lua_dirsep { + try { + return Platform.pathSeparator; + } + catch (e) { + if (e is UnsupportedError) { + // For flutter web + return "/"; + } + else { + throw e; + } + } + } static const Map _pkgFuncs = { "searchpath": _pkgSearchPath,