commit 36990a18b652df75f8bf049bedd19e71babd1edc Author: rnentjes Date: Wed Aug 19 10:42:24 2020 +0200 Worker message @JsExport example diff --git a/.gradle/6.3/executionHistory/executionHistory.bin b/.gradle/6.3/executionHistory/executionHistory.bin new file mode 100644 index 0000000..6ce8f0d Binary files /dev/null and b/.gradle/6.3/executionHistory/executionHistory.bin differ diff --git a/.gradle/6.3/executionHistory/executionHistory.lock b/.gradle/6.3/executionHistory/executionHistory.lock new file mode 100644 index 0000000..b10bf49 Binary files /dev/null and b/.gradle/6.3/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.3/fileChanges/last-build.bin b/.gradle/6.3/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/6.3/fileChanges/last-build.bin differ diff --git a/.gradle/6.3/fileHashes/fileHashes.bin b/.gradle/6.3/fileHashes/fileHashes.bin new file mode 100644 index 0000000..59e050d Binary files /dev/null and b/.gradle/6.3/fileHashes/fileHashes.bin differ diff --git a/.gradle/6.3/fileHashes/fileHashes.lock b/.gradle/6.3/fileHashes/fileHashes.lock new file mode 100644 index 0000000..8345282 Binary files /dev/null and b/.gradle/6.3/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.3/gc.properties b/.gradle/6.3/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..5b554fc Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..019a1dc --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed Aug 19 10:02:07 CEST 2020 +gradle.version=6.3 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..c5fd7c7 Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock new file mode 100644 index 0000000..cc59a10 Binary files /dev/null and b/.gradle/checksums/checksums.lock differ diff --git a/.gradle/checksums/md5-checksums.bin b/.gradle/checksums/md5-checksums.bin new file mode 100644 index 0000000..14f87df Binary files /dev/null and b/.gradle/checksums/md5-checksums.bin differ diff --git a/.gradle/checksums/sha1-checksums.bin b/.gradle/checksums/sha1-checksums.bin new file mode 100644 index 0000000..3fe9073 Binary files /dev/null and b/.gradle/checksums/sha1-checksums.bin differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/artifacts/test_worker_message_js_1_0_SNAPSHOT.xml b/.idea/artifacts/test_worker_message_js_1_0_SNAPSHOT.xml new file mode 100644 index 0000000..1fc10c4 --- /dev/null +++ b/.idea/artifacts/test_worker_message_js_1_0_SNAPSHOT.xml @@ -0,0 +1,6 @@ + + + $PROJECT_DIR$/build/libs + + + \ No newline at end of file diff --git a/.idea/artifacts/test_worker_message_jsworker_1_0_SNAPSHOT.xml b/.idea/artifacts/test_worker_message_jsworker_1_0_SNAPSHOT.xml new file mode 100644 index 0000000..1f377fb --- /dev/null +++ b/.idea/artifacts/test_worker_message_jsworker_1_0_SNAPSHOT.xml @@ -0,0 +1,6 @@ + + + $PROJECT_DIR$/build/libs + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..7e7ee62 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a7087b2 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..fdc392f --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8a7bff4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/test-worker-message.commonMain.iml b/.idea/modules/test-worker-message.commonMain.iml new file mode 100644 index 0000000..fdd4062 --- /dev/null +++ b/.idea/modules/test-worker-message.commonMain.iml @@ -0,0 +1,30 @@ + + + + + + SOURCE_SET_HOLDER + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/test-worker-message.commonTest.iml b/.idea/modules/test-worker-message.commonTest.iml new file mode 100644 index 0000000..d160dc1 --- /dev/null +++ b/.idea/modules/test-worker-message.commonTest.iml @@ -0,0 +1,34 @@ + + + + + + SOURCE_SET_HOLDER + + jsBrowserTest|test-worker-message:jsTest|js + jsWorkerBrowserTest|test-worker-message:jsWorkerTest|jsWorker + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/test-worker-message.jsMain.iml b/.idea/modules/test-worker-message.jsMain.iml new file mode 100644 index 0000000..db44da9 --- /dev/null +++ b/.idea/modules/test-worker-message.jsMain.iml @@ -0,0 +1,46 @@ + + + + + + test-worker-message:commonMain + + test-worker-message.commonMain + + COMPILATION_AND_SOURCE_SET_HOLDER + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/test-worker-message.jsTest.iml b/.idea/modules/test-worker-message.jsTest.iml new file mode 100644 index 0000000..d35b574 --- /dev/null +++ b/.idea/modules/test-worker-message.jsTest.iml @@ -0,0 +1,51 @@ + + + + + + test-worker-message:commonTest + + test-worker-message.commonMain + test-worker-message.commonTest + test-worker-message.jsMain + + COMPILATION_AND_SOURCE_SET_HOLDER + + jsBrowserTest|test-worker-message:jsTest|js + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/test-worker-message.jsWorkerMain.iml b/.idea/modules/test-worker-message.jsWorkerMain.iml new file mode 100644 index 0000000..a61fa25 --- /dev/null +++ b/.idea/modules/test-worker-message.jsWorkerMain.iml @@ -0,0 +1,46 @@ + + + + + + test-worker-message:commonMain + + test-worker-message.commonMain + + COMPILATION_AND_SOURCE_SET_HOLDER + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/test-worker-message.jsWorkerTest.iml b/.idea/modules/test-worker-message.jsWorkerTest.iml new file mode 100644 index 0000000..c8229ff --- /dev/null +++ b/.idea/modules/test-worker-message.jsWorkerTest.iml @@ -0,0 +1,51 @@ + + + + + + test-worker-message:commonTest + + test-worker-message.commonMain + test-worker-message.jsWorkerMain + test-worker-message.commonTest + + COMPILATION_AND_SOURCE_SET_HOLDER + + jsWorkerBrowserTest|test-worker-message:jsWorkerTest|jsWorker + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..4827a16 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,48 @@ +import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target.VAR + +plugins { + kotlin("multiplatform") version "1.4.0" +} +group = "com.banktrade" +version = "1.0-SNAPSHOT" + +repositories { + mavenCentral() +} +kotlin { + js(IR) { + useCommonJs() + binaries.executable() + + browser { + webpackTask { + } + distribution { + directory = File("$projectDir/web/") + } + } + } + js("jsWorker", IR) { + //useCommonJs() + binaries.executable() + browser { + webpackTask { + output.libraryTarget = VAR + output.library = "worker" + } + distribution { + directory = File("$projectDir/web/js/worker") + } + } + } + + sourceSets { + val commonMain by getting + val commonTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + } + } + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..7fc6f1f --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +kotlin.code.style=official diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..490fda8 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..a4b4429 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..2fe81a7 --- /dev/null +++ b/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..62bd9b9 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,103 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/local.properties b/local.properties new file mode 100644 index 0000000..e69de29 diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..699fb5e --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,3 @@ + +rootProject.name = "test-worker-message" + diff --git a/src/commonMain/kotlin/WorkerMessage.kt b/src/commonMain/kotlin/WorkerMessage.kt new file mode 100644 index 0000000..c50378a --- /dev/null +++ b/src/commonMain/kotlin/WorkerMessage.kt @@ -0,0 +1,7 @@ +import kotlin.js.JsExport + +@JsExport +data class WorkerMessage( + val name: String, + val age: Int +) diff --git a/src/jsMain/kotlin/Main.kt b/src/jsMain/kotlin/Main.kt new file mode 100644 index 0000000..4fdd2f4 --- /dev/null +++ b/src/jsMain/kotlin/Main.kt @@ -0,0 +1,9 @@ +import org.w3c.dom.Worker + +fun main() { + val worker = Worker("js/worker/test-worker-message.js") + + val message = WorkerMessage("Test", 42) + console.log("Sending message: ", message) + worker.postMessage(message) +} diff --git a/src/jsMain/resources/index.html b/src/jsMain/resources/index.html new file mode 100644 index 0000000..38b4809 --- /dev/null +++ b/src/jsMain/resources/index.html @@ -0,0 +1,11 @@ + + + + + Test + + + + + + diff --git a/src/jsWorkerMain/kotlin/Main.kt b/src/jsWorkerMain/kotlin/Main.kt new file mode 100644 index 0000000..456f694 --- /dev/null +++ b/src/jsWorkerMain/kotlin/Main.kt @@ -0,0 +1,27 @@ +import org.w3c.dom.MessageEvent +import org.w3c.dom.events.Event +import org.w3c.workers.ServiceWorkerGlobalScope + +external val self: ServiceWorkerGlobalScope + +object Worker { + var id = "" + + fun start() { + console.log("Worker.start"); + + self.onmessage = ::receiveMessage + } + + fun receiveMessage(message: Event) { + if (message is MessageEvent) { + val data = message.data + + console.log("Received message:", data) + } + } +} + +fun main() { + Worker.start() +} diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..38b4809 --- /dev/null +++ b/web/index.html @@ -0,0 +1,11 @@ + + + + + Test + + + + + + diff --git a/web/js/worker/test-worker-message.js b/web/js/worker/test-worker-message.js new file mode 100644 index 0000000..68cae6b --- /dev/null +++ b/web/js/worker/test-worker-message.js @@ -0,0 +1,2 @@ +var worker=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){var r,o,a;o=[e],void 0===(a="function"==typeof(r=function(t){"use strict";function e(){n=this}var n,r;function o(){}function a(t,e){null!=Error.captureStackTrace?Error.captureStackTrace(t,e):t.stack=(new Error).stack}function i(t,e,n){Error.call(t),function(t,e,n){if(!c(t,"message")){var r,o=e;if(null==o){var a=n;r=null==a?null:a.toString()}else r=o;var i=r;t.message=null==i?void 0:i}c(t,"cause")||(t.cause=n),t.name=Object.getPrototypeOf(t).constructor.name}(t,e,n)}function c(t,e){return Object.getPrototypeOf(t).hasOwnProperty(e)}function u(t,e){var n=y(t,4294901760)*y(e,65535),r=y(t,65535)*e;return n+r|0}function s(){a(this,s)}function p(){a(this,p)}function l(){a(this,l)}function f(t){return function(t){i(t,null,null),s.call(t)}(t),p.call(t),t}function m(){var t,e=(f(t=Object.create(l.prototype)),l.call(t),t);return a(e,m),e}function y(t,e){return t&e}function _(t,e){this._name=t,this._age=e}function g(){r=this,this._id=""}function d(t){this._$boundThis=t}return s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,p.prototype=Object.create(s.prototype),p.prototype.constructor=p,l.prototype=Object.create(p.prototype),l.prototype.constructor=l,e.prototype.toString=function(){return"kotlin.Unit"},e.$metadata$={simpleName:"Unit",kind:"object",interfaces:[]},o.$metadata$={simpleName:"KCallable",kind:"interface",interfaces:[]},s.$metadata$={simpleName:"Exception",kind:"class",interfaces:[]},p.$metadata$={simpleName:"RuntimeException",kind:"class",interfaces:[]},l.$metadata$={simpleName:"ClassCastException",kind:"class",interfaces:[]},_.prototype._get_name__0=function(){return this._name},_.prototype._get_age_=function(){return this._age},_.prototype.component1=function(){return this._name},_.prototype.component2=function(){return this._age},_.prototype.copy=function(t,e){return new _(t,e)},_.prototype.copy$default=function(t,e,n,r){var o=0!=(1&n)?this._name:t,a=0!=(2&n)?this._age:e;return this.copy(o,a)},_.prototype.toString=function(){return"WorkerMessage(name="+this._name+", age="+this._age+")"},_.prototype.hashCode=function(){return u(function(t){var e=0,n=t.length,r=0,o=n-1|0;if(r<=o)do{var a=r;r=r+1|0;var i=t.charCodeAt(a);e=u(e,31)+i|0}while(a!==o);return e}(this._name),31)+this._age|0},_.prototype.equals=function(t){if(this===t)return!0;if(!(t instanceof _))return!1;var e=t instanceof _?t:function(){throw m()}();return this._name===e._name&&this._age===e._age},_.$metadata$={simpleName:"WorkerMessage",kind:"class",interfaces:[]},Object.defineProperty(_.prototype,"name",{configurable:!0,get:_.prototype._get_name__0}),Object.defineProperty(_.prototype,"age",{configurable:!0,get:_.prototype._get_age_}),g.prototype.start_0=function(){var t,r;(function(){var t=console;return t.log.apply(t,[].concat([].slice.call(["Worker.start"])))}).call(this),self.onmessage=(t=new d(this),(r=function(r){return t.invoke(r),null==n&&new e,n}).callableName=t._get_name__0(),r)},g.prototype.receiveMessage=function(t){if(t instanceof MessageEvent){var e=t.data;(function(){var t=console;return t.log.apply(t,[].concat([].slice.call(["Received message:",e])))}).call(this)}},g.$metadata$={simpleName:"Worker",kind:"object",interfaces:[]},d.prototype.invoke=function(t){return this._$boundThis.receiveMessage(t)},d.prototype._get_name__0=function(){return"receiveMessage"},d.$metadata$={kind:"class",interfaces:[]},t.WorkerMessage=_,(null==r&&new g,r).start_0(),t})?r.apply(e,o):r)||(t.exports=a)}]); +//# sourceMappingURL=test-worker-message.js.map \ No newline at end of file diff --git a/web/js/worker/test-worker-message.js.map b/web/js/worker/test-worker-message.js.map new file mode 100644 index 0000000..bf776da --- /dev/null +++ b/web/js/worker/test-worker-message.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://worker/webpack/bootstrap","webpack://worker/./kotlin/test-worker-message-jsWorker.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_","Unit","Unit_instance","this","Worker_instance","KCallable","captureStack","instance","constructorFunction","Error","captureStackTrace","stack","extendThrowable","this_","message","cause","hasOwnPrototypeProperty","tmp","tmp1_elvis_lhs","tmp0_safe_receiver","toString","tmp2_elvis_lhs","undefined","getPrototypeOf","constructor","setPropertiesToThrowableInstance","imul","a_local","b_local","lhs","jsBitwiseAnd","rhs","Exception","RuntimeException","ClassCastException","RuntimeException_init_$Init$","$this","Exception_init_$Init$","ClassCastException_init_$Create$","lhs_hack","rhs_hack","WorkerMessage","age","_name","_age","Worker","_id","_no_name_provided_","$boundThis","_$boundThis","$metadata$","simpleName","kind","interfaces","_get_name__0","_get_age_","component1","component2","copy","copy$default","$mask0","$handler","name_0","age_0","hashCode","str","hash","length","inductionVariable","last","code","charCodeAt","getStringHashCode","equals","other","tmp0_other_with_cast","THROW_CCE","configurable","start_0","$externalVarargReceiverTmp","console","log","apply","concat","slice","self","onmessage","p1","invoke","callableName","receiveMessage","MessageEvent","data","p0"],"mappings":"uBACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EA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BC,QACjC,OAAOD,EAA2BE,IAAIC,MAAMH,EAA4B,GAAGI,OAAO,GAAGC,MAAMjH,KAAK,CAAC,qBACjGA,KAAKgC,MACGkF,KACNC,WA2BAtH,EAAI,IAAI+E,EA3B+B5C,OA4BvClC,EAAI,SAAUsH,GAEhB,OADAvH,EAAEwH,OAAOD,GA5NU,MAAjBrF,GACF,IAAID,EACCC,IA6NLuF,aAAezH,EAAEsF,eACZrF,IA/BT4E,EAAOjD,UAAU8F,eAAiB,SAAU5E,GAC1C,GAAIA,aAAmB6E,aAAc,CACnC,IAAIC,EAAO9E,EAAQ8E,MAClB,WACC,IAAIb,EAA6BC,QACjC,OAAOD,EAA2BE,IAAIC,MAAMH,EAA4B,GAAGI,OAAO,GAAGC,MAAMjH,KAAK,CAAC,oBAAqByH,QACtHzH,KAAKgC,QAIX0C,EAAOK,WAAa,CAClBC,WAAY,SACZC,KAAM,SACNC,WAAY,IAuBdN,EAAmBnD,UAAU4F,OAAS,SAAUK,GAC9C,OAAO1F,KAAK8C,YAAYyC,eAAeG,IAEzC9C,EAAmBnD,UAAU0D,aAAe,WAC1C,MAAO,kBAETP,EAAmBG,WAAa,CAC9BE,KAAM,QACNC,WAAY,IAEdrD,EAAEyC,cAAgBA,GA7BO,MAAnBrC,GACF,IAAIyC,EACCzC,GAGc0E,UA0BhB9E,IA3QsB","file":"test-worker-message.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd)\n define(['exports'], factory);\n else if (typeof exports === 'object')\n factory(module.exports);\n else\n root['test-worker-message-jsWorker'] = factory(typeof this['test-worker-message-jsWorker'] === 'undefined' ? {} : this['test-worker-message-jsWorker']);\n}(this, function (_) {\n 'use strict';\n Exception.prototype = Object.create(Error.prototype);\n Exception.prototype.constructor = Exception;\n RuntimeException.prototype = Object.create(Exception.prototype);\n RuntimeException.prototype.constructor = RuntimeException;\n ClassCastException.prototype = Object.create(RuntimeException.prototype);\n ClassCastException.prototype.constructor = ClassCastException;\n function Unit() {\n Unit_instance = this;\n }\n Unit.prototype.toString = function () {\n return 'kotlin.Unit';\n };\n Unit.$metadata$ = {\n simpleName: 'Unit',\n kind: 'object',\n interfaces: []\n };\n var Unit_instance;\n function Unit_getInstance() {\n if (Unit_instance == null)\n new Unit();\n return Unit_instance;\n }\n function KCallable() {\n }\n KCallable.$metadata$ = {\n simpleName: 'KCallable',\n kind: 'interface',\n interfaces: []\n };\n function KFunction() {\n }\n KFunction.$metadata$ = {\n simpleName: 'KFunction',\n kind: 'interface',\n interfaces: [KCallable]\n };\n function getStringHashCode(str) {\n var hash = 0;\n var length = str.length;\n var inductionVariable = 0;\n var last = length - 1 | 0;\n if (inductionVariable <= last)\n do {\n var i = inductionVariable;\n inductionVariable = inductionVariable + 1 | 0;\n var code = str.charCodeAt(i);\n hash = imul(hash, 31) + code | 0;\n }\n while (!(i === last));\n return hash;\n }\n function captureStack(instance, constructorFunction) {\n if (Error.captureStackTrace != null) {\n Error.captureStackTrace(instance, constructorFunction);\n } else {\n instance.stack = (new Error()).stack;\n }\n }\n function extendThrowable(this_, message, cause) {\n Error.call(this_);\n setPropertiesToThrowableInstance(this_, message, cause);\n }\n function setPropertiesToThrowableInstance(this_, message, cause) {\n if (!hasOwnPrototypeProperty(this_, 'message')) {\n var tmp1_elvis_lhs = message;\n var tmp;\n if (tmp1_elvis_lhs == null) {\n var tmp0_safe_receiver = cause;\n tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.toString();\n } else {\n tmp = tmp1_elvis_lhs;\n }\n var tmp2_elvis_lhs = tmp;\n this_.message = tmp2_elvis_lhs == null ? undefined : tmp2_elvis_lhs;\n }if (!hasOwnPrototypeProperty(this_, 'cause')) {\n this_.cause = cause;\n }this_.name = Object.getPrototypeOf(this_).constructor.name;\n }\n function hasOwnPrototypeProperty(o, name) {\n var tmp0_unsafeCast_0 = Object.getPrototypeOf(o).hasOwnProperty(name);\n return tmp0_unsafeCast_0;\n }\n function THROW_CCE() {\n throw ClassCastException_init_$Create$();\n }\n function imul(a_local, b_local) {\n var lhs = jsBitwiseAnd(a_local, 4.29490176E9) * jsBitwiseAnd(b_local, 65535);\n var rhs = jsBitwiseAnd(a_local, 65535) * b_local;\n return jsBitwiseOr(lhs + rhs, 0);\n }\n function Exception() {\n captureStack(this, Exception);\n }\n Exception.$metadata$ = {\n simpleName: 'Exception',\n kind: 'class',\n interfaces: []\n };\n function RuntimeException() {\n captureStack(this, RuntimeException);\n }\n RuntimeException.$metadata$ = {\n simpleName: 'RuntimeException',\n kind: 'class',\n interfaces: []\n };\n function ClassCastException() {\n captureStack(this, ClassCastException);\n }\n ClassCastException.$metadata$ = {\n simpleName: 'ClassCastException',\n kind: 'class',\n interfaces: []\n };\n function Exception_init_$Init$($this) {\n extendThrowable($this, null, null);\n Exception.call($this);\n return $this;\n }\n function RuntimeException_init_$Init$($this) {\n Exception_init_$Init$($this);\n RuntimeException.call($this);\n return $this;\n }\n function ClassCastException_init_$Init$($this) {\n RuntimeException_init_$Init$($this);\n ClassCastException.call($this);\n return $this;\n }\n function ClassCastException_init_$Create$() {\n var tmp = ClassCastException_init_$Init$(Object.create(ClassCastException.prototype));\n captureStack(tmp, ClassCastException_init_$Create$);\n return tmp;\n }\n function jsBitwiseOr(lhs_hack, rhs_hack) {\n var tmp0_unsafeCast_0 = lhs_hack | rhs_hack;\n return tmp0_unsafeCast_0;\n }\n function jsBitwiseAnd(lhs_hack, rhs_hack) {\n var tmp0_unsafeCast_0 = lhs_hack & rhs_hack;\n return tmp0_unsafeCast_0;\n }\n function WorkerMessage(name, age) {\n this._name = name;\n this._age = age;\n }\n WorkerMessage.prototype._get_name__0 = function () {\n return this._name;\n };\n WorkerMessage.prototype._get_age_ = function () {\n return this._age;\n };\n WorkerMessage.prototype.component1 = function () {\n return this._name;\n };\n WorkerMessage.prototype.component2 = function () {\n return this._age;\n };\n WorkerMessage.prototype.copy = function (name, age) {\n return new WorkerMessage(name, age);\n };\n WorkerMessage.prototype.copy$default = function (name, age, $mask0, $handler) {\n var name_0 = !(($mask0 & 1) === 0) ? this._name : name;\n var age_0 = !(($mask0 & 2) === 0) ? this._age : age;\n return this.copy(name_0, age_0);\n };\n WorkerMessage.prototype.toString = function () {\n return '' + 'WorkerMessage(name=' + this._name + ', age=' + this._age + ')';\n };\n WorkerMessage.prototype.hashCode = function () {\n return imul(getStringHashCode(this._name), 31) + this._age | 0;\n };\n WorkerMessage.prototype.equals = function (other) {\n if (this === other)\n return true;\n if (!(other instanceof WorkerMessage))\n return false;\n else {\n }\n var tmp0_other_with_cast = other instanceof WorkerMessage ? other : THROW_CCE();\n if (!(this._name === tmp0_other_with_cast._name))\n return false;\n if (!(this._age === tmp0_other_with_cast._age))\n return false;\n return true;\n };\n WorkerMessage.$metadata$ = {\n simpleName: 'WorkerMessage',\n kind: 'class',\n interfaces: []\n };\n Object.defineProperty(WorkerMessage.prototype, 'name', {\n configurable: true,\n get: WorkerMessage.prototype._get_name__0\n });\n Object.defineProperty(WorkerMessage.prototype, 'age', {\n configurable: true,\n get: WorkerMessage.prototype._get_age_\n });\n function Worker() {\n Worker_instance = this;\n this._id = '';\n }\n Worker.prototype.start_0 = function () {\n (function () {\n var $externalVarargReceiverTmp = console;\n return $externalVarargReceiverTmp.log.apply($externalVarargReceiverTmp, [].concat([].slice.call(['Worker.start'])));\n }.call(this));\n var tmp = self;\n tmp.onmessage = _no_name_provided_$factory(this);\n };\n Worker.prototype.receiveMessage = function (message) {\n if (message instanceof MessageEvent) {\n var data = message.data;\n (function () {\n var $externalVarargReceiverTmp = console;\n return $externalVarargReceiverTmp.log.apply($externalVarargReceiverTmp, [].concat([].slice.call(['Received message:', data])));\n }.call(this));\n } else {\n }\n };\n Worker.$metadata$ = {\n simpleName: 'Worker',\n kind: 'object',\n interfaces: []\n };\n var Worker_instance;\n function Worker_getInstance() {\n if (Worker_instance == null)\n new Worker();\n return Worker_instance;\n }\n function main() {\n Worker_getInstance().start_0();\n }\n function _no_name_provided_$factory($boundThis) {\n var i = new _no_name_provided_($boundThis);\n var l = function (p1) {\n i.invoke(p1);\n return Unit_getInstance();\n };\n l.callableName = i._get_name__0();\n return l;\n }\n function _no_name_provided_($boundThis) {\n this._$boundThis = $boundThis;\n }\n _no_name_provided_.prototype.invoke = function (p0) {\n return this._$boundThis.receiveMessage(p0);\n };\n _no_name_provided_.prototype._get_name__0 = function () {\n return 'receiveMessage';\n };\n _no_name_provided_.$metadata$ = {\n kind: 'class',\n interfaces: []\n };\n _.WorkerMessage = WorkerMessage;\n main();\n return _;\n}));\n"],"sourceRoot":""} \ No newline at end of file diff --git a/web/test-worker-message.js b/web/test-worker-message.js new file mode 100644 index 0000000..b408150 --- /dev/null +++ b/web/test-worker-message.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["test-worker-message"]=t():e["test-worker-message"]=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t){!function(e){"use strict";function t(e,t){null!=Error.captureStackTrace?Error.captureStackTrace(e,t):e.stack=(new Error).stack}function r(e,t,r){Error.call(e),function(e,t,r){if(!n(e,"message")){var o,a=t;if(null==a){var c=r;o=null==c?null:c.toString()}else o=a;var i=o;e.message=null==i?void 0:i}n(e,"cause")||(e.cause=r);e.name=Object.getPrototypeOf(e).constructor.name}(e,t,r)}function n(e,t){return Object.getPrototypeOf(e).hasOwnProperty(t)}function o(e,t){var r=p(e,4294901760)*p(t,65535),n=p(e,65535)*t;return r+n|0}function a(){t(this,a)}function c(){t(this,c)}function i(){t(this,i)}function u(e){return function(e){r(e,null,null),a.call(e)}(e),c.call(e),e}function s(){var e,r=(u(e=Object.create(i.prototype)),i.call(e),e);return t(r,s),r}function p(e,t){return e&t}function f(e,t){this._name=e,this._age=t}a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,c.prototype=Object.create(a.prototype),c.prototype.constructor=c,i.prototype=Object.create(c.prototype),i.prototype.constructor=i,a.$metadata$={simpleName:"Exception",kind:"class",interfaces:[]},c.$metadata$={simpleName:"RuntimeException",kind:"class",interfaces:[]},i.$metadata$={simpleName:"ClassCastException",kind:"class",interfaces:[]},f.prototype._get_name_=function(){return this._name},f.prototype._get_age_=function(){return this._age},f.prototype.component1=function(){return this._name},f.prototype.component2=function(){return this._age},f.prototype.copy=function(e,t){return new f(e,t)},f.prototype.copy$default=function(e,t,r,n){var o=0!=(1&r)?this._name:e,a=0!=(2&r)?this._age:t;return this.copy(o,a)},f.prototype.toString=function(){return"WorkerMessage(name="+this._name+", age="+this._age+")"},f.prototype.hashCode=function(){return o(function(e){var t=0,r=0,n=e.length-1|0;if(r<=n)do{var a=r;r=r+1|0;var c=e.charCodeAt(a);t=o(t,31)+c|0}while(a!==n);return t}(this._name),31)+this._age|0},f.prototype.equals=function(e){if(this===e)return!0;if(!(e instanceof f))return!1;var t=e instanceof f?e:function(){throw s()}();return this._name===t._name&&this._age===t._age},f.$metadata$={simpleName:"WorkerMessage",kind:"class",interfaces:[]},Object.defineProperty(f.prototype,"name",{configurable:!0,get:f.prototype._get_name_}),Object.defineProperty(f.prototype,"age",{configurable:!0,get:f.prototype._get_age_}),e.WorkerMessage=f,function(){var e=new Worker("js/worker/test-worker-message.js",void 0),t=new f("Test",42);(function(){var e=console;return e.log.apply(e,[].concat([].slice.call(["Sending message: ",t])))}).call(this),e.postMessage(t,void 0)}()}(e.exports)}])})); +//# sourceMappingURL=test-worker-message.js.map \ No newline at end of file diff --git a/web/test-worker-message.js.map b/web/test-worker-message.js.map new file mode 100644 index 0000000..207eb73 --- /dev/null +++ b/web/test-worker-message.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://test-worker-message/webpack/universalModuleDefinition","webpack://test-worker-message/webpack/bootstrap","webpack://test-worker-message/./kotlin/test-worker-message.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_","captureStack","instance","constructorFunction","Error","captureStackTrace","stack","extendThrowable","this_","message","cause","hasOwnPrototypeProperty","tmp","tmp1_elvis_lhs","tmp0_safe_receiver","toString","tmp2_elvis_lhs","undefined","getPrototypeOf","constructor","setPropertiesToThrowableInstance","imul","a_local","b_local","lhs","jsBitwiseAnd","rhs","Exception","this","RuntimeException","ClassCastException","RuntimeException_init_$Init$","$this","Exception_init_$Init$","ClassCastException_init_$Create$","lhs_hack","rhs_hack","WorkerMessage","age","_name","_age","$metadata$","simpleName","kind","interfaces","_get_name_","_get_age_","component1","component2","copy","copy$default","$mask0","$handler","name_0","age_0","hashCode","str","hash","inductionVariable","last","length","code","charCodeAt","getStringHashCode","equals","other","tmp0_other_with_cast","THROW_CCE","configurable","worker","Worker","$externalVarargReceiverTmp","console","log","apply","concat","slice","postMessage","main"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,uBAAyBD,IAEjCD,EAAK,uBAAyBC,IARhC,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,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AY,gBACZC,KAAM,QACNC,WAAY,IAEdlE,OAAOC,eAAe0D,EAAczC,UAAW,OAAQ,CACrDwE,cAAc,EACdvF,IAAKwD,EAAczC,UAAUiD,aAE/BnE,OAAOC,eAAe0D,EAAczC,UAAW,MAAO,CACpDwE,cAAc,EACdvF,IAAKwD,EAAczC,UAAUkD,YAW/B9C,EAAEqC,cAAgBA,EATlB,WACE,IAAIgC,EAAS,IAAIC,OAAO,wCAAoC,GACxD7D,EAAU,IAAI4B,EAAc,OAAQ,KACvC,WACC,IAAIkC,EAA6BC,QACjC,OAAOD,EAA2BE,IAAIC,MAAMH,EAA4B,GAAGI,OAAO,GAAGC,MAAMzG,KAAK,CAAC,oBAAqBsC,QACtHtC,KAAKyD,MACPyC,EAAOQ,YAAYpE,OAAS,GAG9BqE,GArLF,CAuLErH,EAAOD","file":"test-worker-message.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"test-worker-message\"] = factory();\n\telse\n\t\troot[\"test-worker-message\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","(function (_) {\n 'use strict';\n Exception.prototype = Object.create(Error.prototype);\n Exception.prototype.constructor = Exception;\n RuntimeException.prototype = Object.create(Exception.prototype);\n RuntimeException.prototype.constructor = RuntimeException;\n ClassCastException.prototype = Object.create(RuntimeException.prototype);\n ClassCastException.prototype.constructor = ClassCastException;\n function getStringHashCode(str) {\n var hash = 0;\n var length = str.length;\n var inductionVariable = 0;\n var last = length - 1 | 0;\n if (inductionVariable <= last)\n do {\n var i = inductionVariable;\n inductionVariable = inductionVariable + 1 | 0;\n var code = str.charCodeAt(i);\n hash = imul(hash, 31) + code | 0;\n }\n while (!(i === last));\n return hash;\n }\n function captureStack(instance, constructorFunction) {\n if (Error.captureStackTrace != null) {\n Error.captureStackTrace(instance, constructorFunction);\n } else {\n instance.stack = (new Error()).stack;\n }\n }\n function extendThrowable(this_, message, cause) {\n Error.call(this_);\n setPropertiesToThrowableInstance(this_, message, cause);\n }\n function setPropertiesToThrowableInstance(this_, message, cause) {\n if (!hasOwnPrototypeProperty(this_, 'message')) {\n var tmp1_elvis_lhs = message;\n var tmp;\n if (tmp1_elvis_lhs == null) {\n var tmp0_safe_receiver = cause;\n tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.toString();\n } else {\n tmp = tmp1_elvis_lhs;\n }\n var tmp2_elvis_lhs = tmp;\n this_.message = tmp2_elvis_lhs == null ? undefined : tmp2_elvis_lhs;\n }if (!hasOwnPrototypeProperty(this_, 'cause')) {\n this_.cause = cause;\n }this_.name = Object.getPrototypeOf(this_).constructor.name;\n }\n function hasOwnPrototypeProperty(o, name) {\n var tmp0_unsafeCast_0 = Object.getPrototypeOf(o).hasOwnProperty(name);\n return tmp0_unsafeCast_0;\n }\n function THROW_CCE() {\n throw ClassCastException_init_$Create$();\n }\n function imul(a_local, b_local) {\n var lhs = jsBitwiseAnd(a_local, 4.29490176E9) * jsBitwiseAnd(b_local, 65535);\n var rhs = jsBitwiseAnd(a_local, 65535) * b_local;\n return jsBitwiseOr(lhs + rhs, 0);\n }\n function Exception() {\n captureStack(this, Exception);\n }\n Exception.$metadata$ = {\n simpleName: 'Exception',\n kind: 'class',\n interfaces: []\n };\n function RuntimeException() {\n captureStack(this, RuntimeException);\n }\n RuntimeException.$metadata$ = {\n simpleName: 'RuntimeException',\n kind: 'class',\n interfaces: []\n };\n function ClassCastException() {\n captureStack(this, ClassCastException);\n }\n ClassCastException.$metadata$ = {\n simpleName: 'ClassCastException',\n kind: 'class',\n interfaces: []\n };\n function Exception_init_$Init$($this) {\n extendThrowable($this, null, null);\n Exception.call($this);\n return $this;\n }\n function RuntimeException_init_$Init$($this) {\n Exception_init_$Init$($this);\n RuntimeException.call($this);\n return $this;\n }\n function ClassCastException_init_$Init$($this) {\n RuntimeException_init_$Init$($this);\n ClassCastException.call($this);\n return $this;\n }\n function ClassCastException_init_$Create$() {\n var tmp = ClassCastException_init_$Init$(Object.create(ClassCastException.prototype));\n captureStack(tmp, ClassCastException_init_$Create$);\n return tmp;\n }\n function jsBitwiseOr(lhs_hack, rhs_hack) {\n var tmp0_unsafeCast_0 = lhs_hack | rhs_hack;\n return tmp0_unsafeCast_0;\n }\n function jsBitwiseAnd(lhs_hack, rhs_hack) {\n var tmp0_unsafeCast_0 = lhs_hack & rhs_hack;\n return tmp0_unsafeCast_0;\n }\n function WorkerMessage(name, age) {\n this._name = name;\n this._age = age;\n }\n WorkerMessage.prototype._get_name_ = function () {\n return this._name;\n };\n WorkerMessage.prototype._get_age_ = function () {\n return this._age;\n };\n WorkerMessage.prototype.component1 = function () {\n return this._name;\n };\n WorkerMessage.prototype.component2 = function () {\n return this._age;\n };\n WorkerMessage.prototype.copy = function (name, age) {\n return new WorkerMessage(name, age);\n };\n WorkerMessage.prototype.copy$default = function (name, age, $mask0, $handler) {\n var name_0 = !(($mask0 & 1) === 0) ? this._name : name;\n var age_0 = !(($mask0 & 2) === 0) ? this._age : age;\n return this.copy(name_0, age_0);\n };\n WorkerMessage.prototype.toString = function () {\n return '' + 'WorkerMessage(name=' + this._name + ', age=' + this._age + ')';\n };\n WorkerMessage.prototype.hashCode = function () {\n return imul(getStringHashCode(this._name), 31) + this._age | 0;\n };\n WorkerMessage.prototype.equals = function (other) {\n if (this === other)\n return true;\n if (!(other instanceof WorkerMessage))\n return false;\n else {\n }\n var tmp0_other_with_cast = other instanceof WorkerMessage ? other : THROW_CCE();\n if (!(this._name === tmp0_other_with_cast._name))\n return false;\n if (!(this._age === tmp0_other_with_cast._age))\n return false;\n return true;\n };\n WorkerMessage.$metadata$ = {\n simpleName: 'WorkerMessage',\n kind: 'class',\n interfaces: []\n };\n Object.defineProperty(WorkerMessage.prototype, 'name', {\n configurable: true,\n get: WorkerMessage.prototype._get_name_\n });\n Object.defineProperty(WorkerMessage.prototype, 'age', {\n configurable: true,\n get: WorkerMessage.prototype._get_age_\n });\n function main() {\n var worker = new Worker('js/worker/test-worker-message.js', void 1);\n var message = new WorkerMessage('Test', 42);\n (function () {\n var $externalVarargReceiverTmp = console;\n return $externalVarargReceiverTmp.log.apply($externalVarargReceiverTmp, [].concat([].slice.call(['Sending message: ', message])));\n }.call(this));\n worker.postMessage(message, void 1);\n }\n _.WorkerMessage = WorkerMessage;\n main();\n return _;\n}(module.exports));\n"],"sourceRoot":""} \ No newline at end of file