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
0824a6a0
Commit
0824a6a0
authored
Jun 03, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide one external API for loading the compiler: compiler.loadVersion
parent
671a90c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
app.js
src/app.js
+2
-2
compiler.js
src/app/compiler.js
+11
-3
No files found.
src/app.js
View file @
0824a6a0
...
...
@@ -422,9 +422,9 @@ var run = function () {
// Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
// resort to non-worker version in that case.
compiler
.
initializeWorker
(
version
,
setVersionText
);
compiler
.
loadVersion
(
true
,
version
,
setVersionText
);
}
else
{
compiler
.
loadVersion
(
version
,
setVersionText
);
compiler
.
loadVersion
(
false
,
version
,
setVersionText
);
}
};
...
...
src/app/compiler.js
View file @
0824a6a0
...
...
@@ -132,7 +132,15 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles
}
}
this
.
loadVersion
=
function
(
version
,
setVersionText
)
{
this
.
loadVersion
=
function
(
usingWorker
,
version
,
setVersionText
)
{
if
(
usingWorker
)
{
loadWorker
(
version
,
setVersionText
);
}
else
{
loadInternal
(
version
,
setVersionText
);
}
};
function
loadInternal
(
version
,
setVersionText
)
{
Module
=
null
;
// Set a safe fallback until the new one is loaded
compileJSON
=
function
(
source
,
optimize
)
{
compilationFinished
(
'{}'
);
};
...
...
@@ -148,9 +156,9 @@ function Compiler (editor, handleGithubCall, outputField, hidingRHP, updateFiles
window
.
clearInterval
(
check
);
onCompilerLoaded
(
setVersionText
);
},
200
);
}
;
}
this
.
initializeWorker
=
function
(
version
,
setVersionText
)
{
function
loadWorker
(
version
,
setVersionText
)
{
if
(
worker
!==
null
)
{
worker
.
terminate
();
}
...
...
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