Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
89150107
Commit
89150107
authored
Jun 08, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use window.Module to be canonical
parent
d568c939
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
compiler-worker.js
src/app/compiler-worker.js
+3
-1
compiler.js
src/app/compiler.js
+3
-2
No files found.
src/app/compiler-worker.js
View file @
89150107
...
...
@@ -7,11 +7,13 @@ module.exports = function (self) {
var
data
=
e
.
data
;
switch
(
data
.
cmd
)
{
case
'loadVersion'
:
delete
Module
;
delete
window
.
Module
;
version
=
null
;
compileJSON
=
null
;
importScripts
(
data
.
data
);
var
Module
=
window
.
Module
;
version
=
Module
.
cwrap
(
'version'
,
'string'
,
[]);
if
(
'_compileJSONCallback'
in
Module
)
{
var
compileJSONInternal
=
Module
.
cwrap
(
'compileJSONCallback'
,
'string'
,
[
'string'
,
'number'
,
'number'
]);
...
...
src/app/compiler.js
View file @
89150107
...
...
@@ -73,6 +73,7 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles
if
(
worker
===
null
)
{
var
compile
;
var
missingInputs
=
[];
var
Module
=
window
.
Module
;
if
(
'_compileJSONCallback'
in
Module
)
{
compilerAcceptsMultipleFiles
=
true
;
var
missingInputsCallback
=
Module
.
Runtime
.
addFunction
(
function
(
path
,
contents
,
error
)
{
...
...
@@ -146,7 +147,7 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles
};
function
loadInternal
(
url
,
setVersionText
)
{
Module
=
null
;
delete
window
.
Module
;
// Set a safe fallback until the new one is loaded
compileJSON
=
function
(
source
,
optimize
)
{
compilationFinished
(
'{}'
);
};
...
...
@@ -155,7 +156,7 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles
newScript
.
src
=
url
;
document
.
getElementsByTagName
(
'head'
)[
0
].
appendChild
(
newScript
);
var
check
=
window
.
setInterval
(
function
()
{
if
(
!
Module
)
{
if
(
!
window
.
Module
)
{
return
;
}
window
.
clearInterval
(
check
);
...
...
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