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
5474e89c
Commit
5474e89c
authored
May 30, 2016
by
Dave Hoover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little more compiler cleanup
parent
9c4a31af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
app.js
src/app.js
+2
-8
compiler.js
src/app/compiler.js
+5
-3
utils.js
src/app/utils.js
+6
-1
No files found.
src/app.js
View file @
5474e89c
...
@@ -20,8 +20,6 @@ window.addEventListener("message", function(ev) {
...
@@ -20,8 +20,6 @@ window.addEventListener("message", function(ev) {
}
}
},
false
);
},
false
);
var
Base64
=
require
(
'js-base64'
).
Base64
;
var
run
=
function
()
{
var
run
=
function
()
{
// ------------------ query params (hash) ----------------
// ------------------ query params (hash) ----------------
...
@@ -446,12 +444,8 @@ var run = function() {
...
@@ -446,12 +444,8 @@ var run = function() {
// ----------------- compiler output renderer ----------------------
// ----------------- compiler output renderer ----------------------
var
detailsOpen
=
{};
var
detailsOpen
=
{};
function
errortype
(
message
)
{
return
message
.
match
(
/^.*:
[
0-9
]
*:
[
0-9
]
* Warning: /
)
?
'warning'
:
'error'
;
}
var
renderError
=
function
(
message
)
{
var
renderError
=
function
(
message
)
{
var
type
=
errortype
(
message
);
var
type
=
utils
.
errortype
(
message
);
var
$pre
=
$
(
"<pre />"
).
text
(
message
);
var
$pre
=
$
(
"<pre />"
).
text
(
message
);
var
$error
=
$
(
'<div class="sol '
+
type
+
'"><div class="close"><i class="fa fa-close"></i></div></div>'
).
prepend
(
$pre
);
var
$error
=
$
(
'<div class="sol '
+
type
+
'"><div class="close"><i class="fa fa-close"></i></div></div>'
).
prepend
(
$pre
);
$
(
'#output'
).
append
(
$error
);
$
(
'#output'
).
append
(
$error
);
...
@@ -665,7 +659,7 @@ var run = function() {
...
@@ -665,7 +659,7 @@ var run = function() {
return
$
.
getJSON
(
'https://api.github.com/repos/'
+
root
+
'/contents/'
+
path
,
cb
);
return
$
.
getJSON
(
'https://api.github.com/repos/'
+
root
+
'/contents/'
+
path
,
cb
);
}
}
var
compiler
=
new
Compiler
(
editor
,
renderContracts
,
renderError
,
errortype
,
handleGithubCall
,
$
(
'#output'
),
function
()
{
return
hidingRHP
;
});
var
compiler
=
new
Compiler
(
editor
,
renderContracts
,
renderError
,
handleGithubCall
,
$
(
'#output'
),
function
()
{
return
hidingRHP
;
});
function
setVersionText
(
text
)
{
function
setVersionText
(
text
)
{
$
(
'#version'
).
text
(
text
);
$
(
'#version'
).
text
(
text
);
...
...
src/app/compiler.js
View file @
5474e89c
var
queryParams
=
require
(
'./query-params'
);
var
queryParams
=
require
(
'./query-params'
);
var
utils
=
require
(
'./utils'
);
var
utils
=
require
(
'./utils'
);
function
Compiler
(
editor
,
renderContracts
,
renderError
,
errortype
,
handleGithubCall
,
outputField
,
hidingRHP
)
{
var
Base64
=
require
(
'js-base64'
).
Base64
;
function
Compiler
(
editor
,
renderContracts
,
renderError
,
handleGithubCall
,
outputField
,
hidingRHP
)
{
var
compileJSON
;
var
compileJSON
;
var
compilerAcceptsMultipleFiles
;
var
compilerAcceptsMultipleFiles
;
...
@@ -108,12 +110,12 @@ function Compiler(editor, renderContracts, renderError, errortype, handleGithubC
...
@@ -108,12 +110,12 @@ function Compiler(editor, renderContracts, renderError, errortype, handleGithubC
if
(
data
[
'error'
]
!==
undefined
)
{
if
(
data
[
'error'
]
!==
undefined
)
{
renderError
(
data
[
'error'
]);
renderError
(
data
[
'error'
]);
if
(
errortype
(
data
[
'error'
])
!==
'warning'
)
noFatalErrors
=
false
;
if
(
utils
.
errortype
(
data
[
'error'
])
!==
'warning'
)
noFatalErrors
=
false
;
}
}
if
(
data
[
'errors'
]
!=
undefined
)
{
if
(
data
[
'errors'
]
!=
undefined
)
{
data
[
'errors'
].
forEach
(
function
(
err
)
{
data
[
'errors'
].
forEach
(
function
(
err
)
{
renderError
(
err
);
renderError
(
err
);
if
(
errortype
(
err
)
!==
'warning'
)
noFatalErrors
=
false
;
if
(
utils
.
errortype
(
err
)
!==
'warning'
)
noFatalErrors
=
false
;
});
});
}
}
...
...
src/app/utils.js
View file @
5474e89c
...
@@ -12,8 +12,13 @@ function fileNameFromKey(key) {
...
@@ -12,8 +12,13 @@ function fileNameFromKey(key) {
return
key
.
replace
(
getCacheFilePrefix
(),
''
);
return
key
.
replace
(
getCacheFilePrefix
(),
''
);
}
}
function
errortype
(
message
)
{
return
message
.
match
(
/^.*:
[
0-9
]
*:
[
0-9
]
* Warning: /
)
?
'warning'
:
'error'
;
}
module
.
exports
=
{
module
.
exports
=
{
getCacheFilePrefix
:
getCacheFilePrefix
,
getCacheFilePrefix
:
getCacheFilePrefix
,
fileKey
:
fileKey
,
fileKey
:
fileKey
,
fileNameFromKey
:
fileNameFromKey
fileNameFromKey
:
fileNameFromKey
,
errortype
:
errortype
};
};
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