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
6b10fccd
Commit
6b10fccd
authored
Sep 06, 2016
by
chriseth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parse source into json for event.
parent
cb05660b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
compiler.js
src/app/compiler.js
+5
-3
No files found.
src/app/compiler.js
View file @
6b10fccd
...
@@ -52,7 +52,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -52,7 +52,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
;
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
;
gatherImports
(
files
,
missingInputs
,
function
(
input
,
error
)
{
gatherImports
(
files
,
missingInputs
,
function
(
input
,
error
)
{
if
(
input
===
null
)
{
if
(
input
===
null
)
{
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
[
error
],
editor
.
getValue
()
]);
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
[
error
],
files
]);
}
else
{
}
else
{
var
optimize
=
queryParams
.
get
().
optimize
;
var
optimize
=
queryParams
.
get
().
optimize
;
compileJSON
(
input
,
optimize
?
1
:
0
);
compileJSON
(
input
,
optimize
?
1
:
0
);
...
@@ -144,7 +144,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -144,7 +144,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
function
loadInternal
(
url
)
{
function
loadInternal
(
url
)
{
delete
window
.
Module
;
delete
window
.
Module
;
// Set a safe fallback until the new one is loaded
// Set a safe fallback until the new one is loaded
setCompileJSON
(
function
(
source
,
optimize
)
{
compilationFinished
(
'{}'
);
});
setCompileJSON
(
function
(
source
,
optimize
)
{
compilationFinished
(
{}
);
});
var
newScript
=
document
.
createElement
(
'script'
);
var
newScript
=
document
.
createElement
(
'script'
);
newScript
.
type
=
'text/javascript'
;
newScript
.
type
=
'text/javascript'
;
...
@@ -173,12 +173,14 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -173,12 +173,14 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
break
;
break
;
case
'compiled'
:
case
'compiled'
:
var
result
;
var
result
;
var
source
;
try
{
try
{
result
=
JSON
.
parse
(
data
.
data
);
result
=
JSON
.
parse
(
data
.
data
);
source
=
JSON
.
parse
(
data
.
source
);
}
catch
(
exception
)
{
}
catch
(
exception
)
{
result
=
{
'error'
:
'Invalid JSON output from the compiler: '
+
exception
};
result
=
{
'error'
:
'Invalid JSON output from the compiler: '
+
exception
};
}
}
compilationFinished
(
result
,
data
.
missingInputs
,
data
.
source
);
compilationFinished
(
result
,
data
.
missingInputs
,
source
);
break
;
break
;
}
}
});
});
...
...
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