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
9b62fc2d
Commit
9b62fc2d
authored
Oct 28, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow the common callback parameter pattern (error, result)
parent
d26e762b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
compiler.js
src/app/compiler.js
+7
-7
No files found.
src/app/compiler.js
View file @
9b62fc2d
...
@@ -27,8 +27,8 @@ function Compiler (editor, handleGithubCall) {
...
@@ -27,8 +27,8 @@ function Compiler (editor, handleGithubCall) {
}
}
var
internalCompile
=
function
(
files
,
missingInputs
)
{
var
internalCompile
=
function
(
files
,
missingInputs
)
{
gatherImports
(
files
,
missingInputs
,
function
(
input
,
error
)
{
gatherImports
(
files
,
missingInputs
,
function
(
error
,
input
)
{
if
(
input
===
null
)
{
if
(
error
)
{
self
.
lastCompilationResult
=
null
self
.
lastCompilationResult
=
null
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
{
'error'
:
error
},
files
])
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
{
'error'
:
error
},
files
])
}
else
{
}
else
{
...
@@ -212,7 +212,7 @@ function Compiler (editor, handleGithubCall) {
...
@@ -212,7 +212,7 @@ function Compiler (editor, handleGithubCall) {
function
gatherImports
(
files
,
importHints
,
cb
)
{
function
gatherImports
(
files
,
importHints
,
cb
)
{
importHints
=
importHints
||
[]
importHints
=
importHints
||
[]
if
(
!
compilerAcceptsMultipleFiles
)
{
if
(
!
compilerAcceptsMultipleFiles
)
{
cb
(
files
[
editor
.
getCacheFile
()])
cb
(
null
,
files
[
editor
.
getCacheFile
()])
return
return
}
}
// FIXME: This will only match imports if the file begins with one.
// FIXME: This will only match imports if the file begins with one.
...
@@ -251,7 +251,7 @@ function Compiler (editor, handleGithubCall) {
...
@@ -251,7 +251,7 @@ function Compiler (editor, handleGithubCall) {
}
else
if
((
githubMatch
=
/^
(
https
?
:
\/\/)?(
www.
)?
github.com
\/([^\/]
*
\/[^\/]
*
)\/(
.*
)
/
.
exec
(
m
)))
{
}
else
if
((
githubMatch
=
/^
(
https
?
:
\/\/)?(
www.
)?
github.com
\/([^\/]
*
\/[^\/]
*
)\/(
.*
)
/
.
exec
(
m
)))
{
handleGithubCall
(
githubMatch
[
3
],
githubMatch
[
4
],
function
(
err
,
content
)
{
handleGithubCall
(
githubMatch
[
3
],
githubMatch
[
4
],
function
(
err
,
content
)
{
if
(
err
)
{
if
(
err
)
{
cb
(
null
,
'Unable to import "'
+
m
+
'": '
+
err
)
cb
(
'Unable to import "'
+
m
+
'": '
+
err
)
return
return
}
}
...
@@ -262,15 +262,15 @@ function Compiler (editor, handleGithubCall) {
...
@@ -262,15 +262,15 @@ function Compiler (editor, handleGithubCall) {
})
})
return
return
}
else
if
(
/^
[^
:
]
*:
\/\/
/
.
exec
(
m
))
{
}
else
if
(
/^
[^
:
]
*:
\/\/
/
.
exec
(
m
))
{
cb
(
null
,
'Unable to import "'
+
m
+
'": Unsupported URL'
)
cb
(
'Unable to import "'
+
m
+
'": Unsupported URL'
)
return
return
}
else
{
}
else
{
cb
(
null
,
'Unable to import "'
+
m
+
'": File not found'
)
cb
(
'Unable to import "'
+
m
+
'": File not found'
)
return
return
}
}
}
}
}
while
(
reloop
)
}
while
(
reloop
)
cb
({
'sources'
:
files
})
cb
(
null
,
{
'sources'
:
files
})
}
}
}
}
...
...
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