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
e90747a1
Commit
e90747a1
authored
Aug 30, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix loading compiler in unit testing
parent
3c35257e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
compiler-utils.ts
libs/remix-solidity/src/compiler/compiler-utils.ts
+13
-1
compiler-container.tsx
...remix-ui/solidity-compiler/src/lib/compiler-container.tsx
+7
-11
No files found.
libs/remix-solidity/src/compiler/compiler-utils.ts
View file @
e90747a1
...
@@ -12,9 +12,21 @@ export const pathToURL = {}
...
@@ -12,9 +12,21 @@ export const pathToURL = {}
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix
*/
*/
export
function
urlFromVersion
(
version
)
{
export
function
urlFromVersion
(
version
)
{
let
url
if
(
version
===
'builtin'
)
{
let
location
:
string
|
Location
=
window
.
document
.
location
let
path
=
location
.
pathname
if
(
!
path
.
startsWith
(
'/'
))
path
=
'/'
+
path
location
=
`
${
location
.
protocol
}
//
${
location
.
host
}${
path
}
assets/js`
if
(
location
.
endsWith
(
'index.html'
))
location
=
location
.
substring
(
0
,
location
.
length
-
10
)
if
(
!
location
.
endsWith
(
'/'
))
location
+=
'/'
url
=
`
${
location
}
soljson.js`
}
else
{
if
(
!
version
.
startsWith
(
'soljson-v'
))
version
=
'soljson-v'
+
version
if
(
!
version
.
startsWith
(
'soljson-v'
))
version
=
'soljson-v'
+
version
if
(
!
version
.
endsWith
(
'.js'
))
version
=
version
+
'.js'
if
(
!
version
.
endsWith
(
'.js'
))
version
=
version
+
'.js'
return
`
${
pathToURL
[
version
]}
/
${
version
}
`
url
=
`
${
pathToURL
[
version
]}
/
${
version
}
`
}
return
url
}
}
/**
/**
...
...
libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
View file @
e90747a1
...
@@ -333,19 +333,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -333,19 +333,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
updateCurrentVersion
(
selectedVersion
)
updateCurrentVersion
(
selectedVersion
)
url
=
customUrl
url
=
customUrl
api
.
setParameters
({
version
:
selectedVersion
})
api
.
setParameters
({
version
:
selectedVersion
})
}
else
if
(
selectedVersion
===
'builtin'
)
{
let
location
:
string
|
Location
=
window
.
document
.
location
let
path
=
location
.
pathname
if
(
!
path
.
startsWith
(
'/'
))
path
=
'/'
+
path
location
=
`
${
location
.
protocol
}
//
${
location
.
host
}${
path
}
assets/js`
if
(
location
.
endsWith
(
'index.html'
))
location
=
location
.
substring
(
0
,
location
.
length
-
10
)
if
(
!
location
.
endsWith
(
'/'
))
location
+=
'/'
url
=
location
+
'soljson.js'
}
else
{
}
else
{
if
(
selectedVersion
.
indexOf
(
'soljson'
)
!==
0
||
helper
.
checkSpecialChars
(
selectedVersion
))
{
if
(
helper
.
checkSpecialChars
(
selectedVersion
))
{
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed'
)
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed, special chars not allowed.'
)
}
if
(
selectedVersion
===
'builtin'
||
selectedVersion
.
indexOf
(
'soljson'
)
===
0
)
{
url
=
urlFromVersion
(
selectedVersion
)
}
else
{
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed, version should start with "soljson"'
)
}
}
url
=
`
${
urlFromVersion
(
selectedVersion
)}
`
}
}
// Workers cannot load js on "file:"-URLs and we get a
// Workers cannot load js on "file:"-URLs and we get a
...
...
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