Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
erp5
Commits
79e8085d
Commit
79e8085d
authored
Jul 17, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_notebook: Don't make function inside a loop...
parent
7b177111
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+20
-13
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
79e8085d
...
@@ -124,34 +124,41 @@
...
@@ -124,34 +124,41 @@
// can't be done synchronously within the call to dlopen, we instantiate
// can't be done synchronously within the call to dlopen, we instantiate
// every .so that comes our way up front, caching it in the
// every .so that comes our way up front, caching it in the
// `preloadedWasm` dictionary.
// `preloadedWasm` dictionary.
var
queue
,
FS
;
var
queue
,
FS
,
path
;
queue
=
new
RSVP
.
Queue
();
queue
=
new
RSVP
.
Queue
();
FS
=
pyodide
.
_module
.
FS
;
FS
=
pyodide
.
_module
.
FS
;
function
recurseDir
(
rootpath
)
{
function
recurseDir
(
rootpath
)
{
var
i
,
entry
,
dirs
,
path
;
var
i
,
entry
,
dirs
;
try
{
try
{
dirs
=
FS
.
readdir
(
rootpath
);
dirs
=
FS
.
readdir
(
rootpath
);
}
catch
(
e
)
{
}
catch
(
e
)
{
return
;
return
;
}
}
function
readModuleFile
(
path
)
{
return
function
()
{
return
Module
.
loadWebAssemblyModule
(
FS
.
readFile
(
path
),
{
loadAsync
:
true
}
);
};
}
function
setModule
(
path
)
{
return
function
(
module
)
{
Module
.
preloadedWasm
[
path
]
=
module
;
};
}
for
(
i
=
0
;
i
<
dirs
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
dirs
.
length
;
i
+=
1
)
{
entry
=
dirs
[
i
];
entry
=
dirs
[
i
];
if
(
!
entry
.
startsWith
(
'
.
'
))
{
if
(
!
entry
.
startsWith
(
'
.
'
))
{
const
path
=
rootpath
+
entry
;
path
=
rootpath
+
entry
;
if
(
entry
.
endsWith
(
'
.so
'
))
{
if
(
entry
.
endsWith
(
'
.so
'
))
{
if
(
Module
.
preloadedWasm
[
path
]
===
undefined
)
{
if
(
Module
.
preloadedWasm
[
path
]
===
undefined
)
{
queue
.
push
(
function
()
{
queue
.
push
(
readModuleFile
(
path
))
return
Module
.
loadWebAssemblyModule
(
.
push
(
setModule
(
path
));
FS
.
readFile
(
path
),
{
loadAsync
:
true
}
)
})
.
push
(
function
(
module
)
{
Module
.
preloadedWasm
[
path
]
=
module
;
});
}
}
}
else
if
(
FS
.
isDir
(
FS
.
lookupPath
(
path
).
node
.
mode
))
{
}
else
if
(
FS
.
isDir
(
FS
.
lookupPath
(
path
).
node
.
mode
))
{
recurseDir
(
path
+
'
/
'
);
recurseDir
(
path
+
'
/
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment