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
ebe8b2e3
Commit
ebe8b2e3
authored
Sep 07, 2016
by
chriseth
Committed by
GitHub
Sep 07, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #216 from ethereum/compiler-load-events
Cleanup compiler load events
parents
0fcf0ca0
b4f1857e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
app.js
src/app.js
+5
-6
compiler-worker.js
src/app/compiler-worker.js
+3
-0
compiler.js
src/app/compiler.js
+4
-0
No files found.
src/app.js
View file @
ebe8b2e3
...
...
@@ -444,14 +444,14 @@ var run = function () {
compiler
.
compile
();
});
compiler
.
event
.
register
(
'compilerLoaded'
,
this
,
function
(
context
)
{
compiler
.
compile
();
initWithQueryParams
();
compiler
.
event
.
register
(
'loadingCompiler'
,
this
,
function
(
url
,
usingWorker
)
{
setVersionText
(
usingWorker
?
'(loading using worker)'
:
'(loading)'
);
});
compiler
.
event
.
register
(
'compilerLoaded'
,
this
,
function
(
version
)
{
setVersionText
(
version
);
compiler
.
compile
();
initWithQueryParams
();
});
function
initWithQueryParams
()
{
...
...
@@ -475,8 +475,7 @@ var run = function () {
$
(
'#version'
).
text
(
text
);
}
var
loadVersion
=
function
(
version
)
{
setVersionText
(
'(loading)'
);
function
loadVersion
(
version
)
{
queryParams
.
update
({
version
:
version
});
if
(
window
.
soljsonReleases
!==
undefined
&&
window
.
soljsonReleases
[
version
]
!==
undefined
)
{
version
=
window
.
soljsonReleases
[
version
];
...
...
@@ -496,7 +495,7 @@ var run = function () {
}
else
{
compiler
.
loadVersion
(
false
,
url
);
}
}
;
}
document
.
querySelector
(
'#optimize'
).
addEventListener
(
'change'
,
function
()
{
queryParams
.
update
({
optimize
:
document
.
querySelector
(
'#optimize'
).
checked
});
...
...
src/app/compiler-worker.js
View file @
ebe8b2e3
...
...
@@ -9,6 +9,9 @@ module.exports = function (self) {
switch
(
data
.
cmd
)
{
case
'loadVersion'
:
delete
self
.
Module
;
// NOTE: workaround some browsers?
self
.
Module
=
undefined
;
compileJSON
=
null
;
self
.
importScripts
(
data
.
data
);
...
...
src/app/compiler.js
View file @
ebe8b2e3
...
...
@@ -133,6 +133,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
this
.
loadVersion
=
function
(
usingWorker
,
url
)
{
console
.
log
(
'Loading '
+
url
+
' '
+
(
usingWorker
?
'with worker'
:
'without worker'
));
self
.
event
.
trigger
(
'loadingCompiler'
,
[
url
,
usingWorker
]);
if
(
usingWorker
)
{
loadWorker
(
url
);
...
...
@@ -143,6 +144,9 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
function
loadInternal
(
url
)
{
delete
window
.
Module
;
// NOTE: workaround some browsers?
window
.
Module
=
undefined
;
// Set a safe fallback until the new one is loaded
setCompileJSON
(
function
(
source
,
optimize
)
{
compilationFinished
({
error
:
'Compiler not yet loaded.'
});
...
...
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