File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
var linkBytecode = function ( bytecode , libraries ) {
2
+ // NOTE: for backwards compatibility support old compiler which didn't use file names
3
+ var librariesComplete = { } ;
2
4
for ( var libraryName in libraries ) {
5
+ var parsed = libraryName . match ( / ^ ( [ ^ : ] * ) : ? ( .* ) $ / ) ;
6
+ if ( parsed ) {
7
+ librariesComplete [ parsed [ 2 ] ] = libraries [ libraryName ] ;
8
+ }
9
+ librariesComplete [ libraryName ] = libraries [ libraryName ] ;
10
+ }
11
+
12
+ for ( libraryName in librariesComplete ) {
3
13
// truncate to 37 characters
4
14
var internalName = libraryName . slice ( 0 , 36 ) ;
5
15
// prefix and suffix with __
6
16
var libLabel = '__' + internalName + Array ( 37 - internalName . length ) . join ( '_' ) + '__' ;
7
17
8
- var hexAddress = libraries [ libraryName ] ;
18
+ var hexAddress = librariesComplete [ libraryName ] ;
9
19
if ( hexAddress . slice ( 0 , 2 ) !== '0x' || hexAddress . length > 42 ) {
10
20
throw new Error ( 'Invalid address specified for ' + libraryName ) ;
11
21
}
You can’t perform that action at this time.
0 commit comments