File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11( function ( ) {
2- function evalPureScript ( sources ) {
2+ function evalSources ( sources ) {
33 var modules = { } ;
44 function dirname ( str ) {
55 var ix = str . lastIndexOf ( "/" ) ;
2727 } ;
2828 }
2929
30- function loadScripts ( scripts , cb ) {
31- if ( scripts . length === 0 ) {
32- return cb ( ) ;
33- }
34- var script = document . createElement ( "script" ) ;
35- script . type = "text/javascript" ;
36- script . src = scripts [ 0 ] ;
37- script . addEventListener ( "load" , function ( ) {
38- loadScripts ( scripts . slice ( 1 ) , cb ) ;
39- } , { once : true } ) ;
40- document . head . appendChild ( script ) ;
41- }
42-
4330 document . addEventListener ( "DOMContentLoaded" , function ( ) {
4431 window . addEventListener ( "message" , function ( event ) {
45- loadScripts ( event . data . scripts , function ( ) {
46- var file = evalPureScript ( event . data . sources ) ( "<file>" ) ;
47- if ( file . main && typeof file . main === "function" ) {
48- file . main ( ) ;
49- }
50- } ) ;
5132 event . source . postMessage ( "trypurescript" , "*" ) ;
33+ var file = evalSources ( event . data ) ( "<file>" ) ;
34+ if ( file . main && typeof file . main === "function" ) {
35+ file . main ( ) ;
36+ }
5237 } , { once : true } ) ;
5338 } , { once : true } ) ;
54- } ) ( ) ;
39+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments