@swf2es/player-hosts 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/LICENSE.third-party +759 -0
- package/README.md +43 -2
- package/dist/indexeddb.d.ts +27 -0
- package/dist/indexeddb.d.ts.map +1 -0
- package/dist/indexeddb.js +170 -0
- package/dist/indexeddb.js.map +1 -0
- package/dist/node-worker.d.ts +2 -0
- package/dist/node-worker.d.ts.map +1 -0
- package/dist/node-worker.js +12 -0
- package/dist/node-worker.js.map +1 -0
- package/dist/node.d.ts +8 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +43 -0
- package/dist/node.js.map +1 -0
- package/dist/precompiled.d.ts +31 -0
- package/dist/precompiled.d.ts.map +1 -0
- package/dist/precompiled.js +125 -0
- package/dist/precompiled.js.map +1 -0
- package/dist/stage3d.d.ts +13 -0
- package/dist/stage3d.d.ts.map +1 -0
- package/dist/stage3d.js +61 -0
- package/dist/stage3d.js.map +1 -0
- package/dist/thread/codegen/codegen.js +308 -0
- package/dist/thread/codegen/index.js +405 -0
- package/dist/thread/format/abc-names.js +126 -0
- package/dist/thread/format/actions.js +222 -0
- package/dist/thread/format/air-descriptor.js +63 -0
- package/dist/thread/format/api-versions.js +22 -0
- package/dist/thread/format/bitmap.js +199 -0
- package/dist/thread/format/button.js +60 -0
- package/dist/thread/format/compression.js +200 -0
- package/dist/thread/format/display.js +305 -0
- package/dist/thread/format/filters.js +136 -0
- package/dist/thread/format/font.js +168 -0
- package/dist/thread/format/index.js +26 -0
- package/dist/thread/format/pbj.js +484 -0
- package/dist/thread/format/shape.js +411 -0
- package/dist/thread/format/sound.js +91 -0
- package/dist/thread/format/swf.js +163 -0
- package/dist/thread/format/tags.js +58 -0
- package/dist/thread/format/text.js +135 -0
- package/dist/thread/format/zip.js +91 -0
- package/dist/thread/native/audio/binary.js +3 -0
- package/dist/thread/native/audio/index.js +72 -0
- package/dist/thread/native/base64.js +9 -0
- package/dist/thread/native/compress/binary.js +3 -0
- package/dist/thread/native/compress/index.js +145 -0
- package/dist/thread/native/instance.js +49 -0
- package/dist/thread/native/mp3/binary.js +3 -0
- package/dist/thread/native/mp3/index.js +48 -0
- package/dist/thread/native/render/binary.js +3 -0
- package/dist/thread/native/render/bitmap-kernel.js +591 -0
- package/dist/thread/native/render/draw-kernel.js +204 -0
- package/dist/thread/native/render/dxt-encoder.js +94 -0
- package/dist/thread/native/render/index.js +10 -0
- package/dist/thread/native/render/lines.js +122 -0
- package/dist/thread/native/render/module.js +26 -0
- package/dist/thread/native/render/pixel-ops.js +235 -0
- package/dist/thread/native/render/tessellator.js +250 -0
- package/dist/thread/player/avm1/amf.js +507 -0
- package/dist/thread/player/avm1/avm1.js +1304 -0
- package/dist/thread/player/avm1/bindings.js +214 -0
- package/dist/thread/player/avm1/classes.js +75 -0
- package/dist/thread/player/avm1/clips.js +229 -0
- package/dist/thread/player/avm1/compile.js +140 -0
- package/dist/thread/player/avm1/external.js +79 -0
- package/dist/thread/player/avm1/focus.js +278 -0
- package/dist/thread/player/avm1/globals/BitmapData.js +542 -0
- package/dist/thread/player/avm1/globals/Button.js +31 -0
- package/dist/thread/player/avm1/globals/Color.js +115 -0
- package/dist/thread/player/avm1/globals/ExternalInterface.js +310 -0
- package/dist/thread/player/avm1/globals/FileReference.js +217 -0
- package/dist/thread/player/avm1/globals/Key.js +60 -0
- package/dist/thread/player/avm1/globals/LoadVars.js +208 -0
- package/dist/thread/player/avm1/globals/LocalConnection.js +92 -0
- package/dist/thread/player/avm1/globals/MovieClip.js +1070 -0
- package/dist/thread/player/avm1/globals/MovieClipLoader.js +90 -0
- package/dist/thread/player/avm1/globals/NetConnection.js +261 -0
- package/dist/thread/player/avm1/globals/PrintJob.js +37 -0
- package/dist/thread/player/avm1/globals/Selection.js +62 -0
- package/dist/thread/player/avm1/globals/SharedObject.js +245 -0
- package/dist/thread/player/avm1/globals/Sound.js +238 -0
- package/dist/thread/player/avm1/globals/Stage.js +12 -0
- package/dist/thread/player/avm1/globals/StyleSheet.js +205 -0
- package/dist/thread/player/avm1/globals/TextField.js +396 -0
- package/dist/thread/player/avm1/globals/TextFormat.js +194 -0
- package/dist/thread/player/avm1/globals/TextSnapshot.js +88 -0
- package/dist/thread/player/avm1/globals/XML.js +396 -0
- package/dist/thread/player/avm1/globals/XMLNode.js +413 -0
- package/dist/thread/player/avm1/globals/XMLSocket.js +205 -0
- package/dist/thread/player/avm1/globals/drawing.js +202 -0
- package/dist/thread/player/avm1/globals/filters.js +635 -0
- package/dist/thread/player/avm1/globals/geom.js +600 -0
- package/dist/thread/player/avm1/input.js +483 -0
- package/dist/thread/player/avm1/keyboard.js +113 -0
- package/dist/thread/player/avm1/loads.js +352 -0
- package/dist/thread/player/avm1/net.js +219 -0
- package/dist/thread/player/avm1/paths.js +104 -0
- package/dist/thread/player/avm1/pointer.js +512 -0
- package/dist/thread/player/avm1/queue.js +303 -0
- package/dist/thread/player/avm1/sound.js +106 -0
- package/dist/thread/player/avm1/swf.js +141 -0
- package/dist/thread/player/avm1/timers.js +113 -0
- package/dist/thread/player/bitmap/bitmap.js +627 -0
- package/dist/thread/player/bitmap/draw.js +68 -0
- package/dist/thread/player/bitmap/dxt.js +11 -0
- package/dist/thread/player/bitmap/filters.js +656 -0
- package/dist/thread/player/bitmap/images.js +240 -0
- package/dist/thread/player/bitmap/kernel.js +65 -0
- package/dist/thread/player/bitmap/ops.js +1239 -0
- package/dist/thread/player/bitmap/pixel-bender.js +911 -0
- package/dist/thread/player/bitmap/png.js +139 -0
- package/dist/thread/player/bitmap/turbulence.js +89 -0
- package/dist/thread/player/clock.js +182 -0
- package/dist/thread/player/display/bitmapobject.js +25 -0
- package/dist/thread/player/display/bounds.js +520 -0
- package/dist/thread/player/display/buttonobject.js +305 -0
- package/dist/thread/player/display/color.js +40 -0
- package/dist/thread/player/display/container.js +150 -0
- package/dist/thread/player/display/display.js +14 -0
- package/dist/thread/player/display/displayobject.js +664 -0
- package/dist/thread/player/display/drawing.js +613 -0
- package/dist/thread/player/display/filters.js +285 -0
- package/dist/thread/player/display/geometry.js +189 -0
- package/dist/thread/player/display/gradients.js +117 -0
- package/dist/thread/player/display/graphicsdata.js +592 -0
- package/dist/thread/player/display/instantiate.js +71 -0
- package/dist/thread/player/display/matrix3d.js +373 -0
- package/dist/thread/player/display/morph.js +226 -0
- package/dist/thread/player/display/movieclip.js +680 -0
- package/dist/thread/player/display/perspective.js +193 -0
- package/dist/thread/player/display/scale9.js +236 -0
- package/dist/thread/player/display/shapeobject.js +131 -0
- package/dist/thread/player/display/shapes.js +407 -0
- package/dist/thread/player/display/textobjects.js +222 -0
- package/dist/thread/player/display/timeline.js +471 -0
- package/dist/thread/player/display/value-lists.js +40 -0
- package/dist/thread/player/display/videoobject.js +6 -0
- package/dist/thread/player/display/walk.js +127 -0
- package/dist/thread/player/files.js +334 -0
- package/dist/thread/player/hosts.js +207 -0
- package/dist/thread/player/input/avm1.js +82 -0
- package/dist/thread/player/input/context-menu.js +63 -0
- package/dist/thread/player/input/keyboard.js +458 -0
- package/dist/thread/player/input/pointer.js +863 -0
- package/dist/thread/player/input/text-editor.js +319 -0
- package/dist/thread/player/input/touch.js +209 -0
- package/dist/thread/player/localconnection.js +90 -0
- package/dist/thread/player/media/audio.js +376 -0
- package/dist/thread/player/media/dynamic-sound.js +90 -0
- package/dist/thread/player/media/extract.js +135 -0
- package/dist/thread/player/media/mp3.js +152 -0
- package/dist/thread/player/media/sounds.js +507 -0
- package/dist/thread/player/media/streaming-audio.js +133 -0
- package/dist/thread/player/player.js +616 -0
- package/dist/thread/player/playerglobal/air/net/WebSocket.js +250 -0
- package/dist/thread/player/playerglobal/air-library.js +8 -0
- package/dist/thread/player/playerglobal/flash/accessibility/Accessibility.js +21 -0
- package/dist/thread/player/playerglobal/flash/crypto/generateRandomBytes.js +32 -0
- package/dist/thread/player/playerglobal/flash/data/EncryptedLocalStore.js +61 -0
- package/dist/thread/player/playerglobal/flash/desktop/Clipboard.js +173 -0
- package/dist/thread/player/playerglobal/flash/desktop/NativeApplication.js +179 -0
- package/dist/thread/player/playerglobal/flash/display/AVM1Movie.js +19 -0
- package/dist/thread/player/playerglobal/flash/display/Bitmap.js +58 -0
- package/dist/thread/player/playerglobal/flash/display/BitmapData.js +633 -0
- package/dist/thread/player/playerglobal/flash/display/DisplayObject.js +614 -0
- package/dist/thread/player/playerglobal/flash/display/DisplayObjectContainer.js +224 -0
- package/dist/thread/player/playerglobal/flash/display/Graphics.js +345 -0
- package/dist/thread/player/playerglobal/flash/display/InteractiveObject.js +87 -0
- package/dist/thread/player/playerglobal/flash/display/Loader.js +79 -0
- package/dist/thread/player/playerglobal/flash/display/LoaderInfo.js +128 -0
- package/dist/thread/player/playerglobal/flash/display/MovieClip.js +194 -0
- package/dist/thread/player/playerglobal/flash/display/NativeWindow.js +245 -0
- package/dist/thread/player/playerglobal/flash/display/Shader.js +26 -0
- package/dist/thread/player/playerglobal/flash/display/ShaderData.js +85 -0
- package/dist/thread/player/playerglobal/flash/display/ShaderInput.js +64 -0
- package/dist/thread/player/playerglobal/flash/display/ShaderJob.js +181 -0
- package/dist/thread/player/playerglobal/flash/display/ShaderParameter.js +23 -0
- package/dist/thread/player/playerglobal/flash/display/Shape.js +13 -0
- package/dist/thread/player/playerglobal/flash/display/SimpleButton.js +103 -0
- package/dist/thread/player/playerglobal/flash/display/Sprite.js +84 -0
- package/dist/thread/player/playerglobal/flash/display/Stage.js +231 -0
- package/dist/thread/player/playerglobal/flash/display/Stage3D.js +54 -0
- package/dist/thread/player/playerglobal/flash/display/shaders.js +228 -0
- package/dist/thread/player/playerglobal/flash/events/Event.js +58 -0
- package/dist/thread/player/playerglobal/flash/events/EventDispatcher.js +103 -0
- package/dist/thread/player/playerglobal/flash/events/GestureEvent.js +34 -0
- package/dist/thread/player/playerglobal/flash/events/HTTPStatusEvent.js +8 -0
- package/dist/thread/player/playerglobal/flash/events/KeyboardEvent.js +51 -0
- package/dist/thread/player/playerglobal/flash/events/MouseEvent.js +59 -0
- package/dist/thread/player/playerglobal/flash/events/PressAndTapGestureEvent.js +30 -0
- package/dist/thread/player/playerglobal/flash/events/TimerEvent.js +16 -0
- package/dist/thread/player/playerglobal/flash/events/TouchEvent.js +45 -0
- package/dist/thread/player/playerglobal/flash/external/ExternalInterface.js +73 -0
- package/dist/thread/player/playerglobal/flash/filesystem/File.js +340 -0
- package/dist/thread/player/playerglobal/flash/filesystem/FileStream.js +453 -0
- package/dist/thread/player/playerglobal/flash/filesystem/paths.js +156 -0
- package/dist/thread/player/playerglobal/flash/filesystem/writes.js +143 -0
- package/dist/thread/player/playerglobal/flash/filters/BevelFilter.js +4 -0
- package/dist/thread/player/playerglobal/flash/filters/BitmapFilter.js +205 -0
- package/dist/thread/player/playerglobal/flash/filters/BlurFilter.js +4 -0
- package/dist/thread/player/playerglobal/flash/filters/ColorMatrixFilter.js +11 -0
- package/dist/thread/player/playerglobal/flash/filters/ConvolutionFilter.js +26 -0
- package/dist/thread/player/playerglobal/flash/filters/DisplacementMapFilter.js +51 -0
- package/dist/thread/player/playerglobal/flash/filters/DropShadowFilter.js +4 -0
- package/dist/thread/player/playerglobal/flash/filters/GlowFilter.js +4 -0
- package/dist/thread/player/playerglobal/flash/filters/GradientBevelFilter.js +4 -0
- package/dist/thread/player/playerglobal/flash/filters/GradientGlowFilter.js +4 -0
- package/dist/thread/player/playerglobal/flash/filters/ShaderFilter.js +53 -0
- package/dist/thread/player/playerglobal/flash/geom/Matrix3D.js +361 -0
- package/dist/thread/player/playerglobal/flash/geom/PerspectiveProjection.js +122 -0
- package/dist/thread/player/playerglobal/flash/geom/Transform.js +245 -0
- package/dist/thread/player/playerglobal/flash/geom/Utils3D.js +85 -0
- package/dist/thread/player/playerglobal/flash/globalization/Collator.js +149 -0
- package/dist/thread/player/playerglobal/flash/globalization/CurrencyFormatter.js +272 -0
- package/dist/thread/player/playerglobal/flash/globalization/CurrencyParseResult.js +21 -0
- package/dist/thread/player/playerglobal/flash/globalization/DateTimeFormatter.js +463 -0
- package/dist/thread/player/playerglobal/flash/globalization/LocaleID.js +144 -0
- package/dist/thread/player/playerglobal/flash/globalization/NumberFormatter.js +444 -0
- package/dist/thread/player/playerglobal/flash/globalization/NumberParseResult.js +22 -0
- package/dist/thread/player/playerglobal/flash/globalization/StringTools.js +59 -0
- package/dist/thread/player/playerglobal/flash/globalization/locale.js +190 -0
- package/dist/thread/player/playerglobal/flash/media/Camera.js +89 -0
- package/dist/thread/player/playerglobal/flash/media/Microphone.js +126 -0
- package/dist/thread/player/playerglobal/flash/media/Sound.js +543 -0
- package/dist/thread/player/playerglobal/flash/media/SoundMixer.js +74 -0
- package/dist/thread/player/playerglobal/flash/media/SoundTransform.js +40 -0
- package/dist/thread/player/playerglobal/flash/media/Video.js +43 -0
- package/dist/thread/player/playerglobal/flash/net/FileFilter.js +27 -0
- package/dist/thread/player/playerglobal/flash/net/FileReference.js +197 -0
- package/dist/thread/player/playerglobal/flash/net/LocalConnection.js +167 -0
- package/dist/thread/player/playerglobal/flash/net/NetConnection.js +155 -0
- package/dist/thread/player/playerglobal/flash/net/SharedObject.js +299 -0
- package/dist/thread/player/playerglobal/flash/net/Socket.js +282 -0
- package/dist/thread/player/playerglobal/flash/net/URLRequest.js +93 -0
- package/dist/thread/player/playerglobal/flash/net/URLStream.js +146 -0
- package/dist/thread/player/playerglobal/flash/net/XMLSocket.js +14 -0
- package/dist/thread/player/playerglobal/flash/net/local-modern.js +142 -0
- package/dist/thread/player/playerglobal/flash/net/local-values.js +217 -0
- package/dist/thread/player/playerglobal/flash/net/navigateToURL.js +29 -0
- package/dist/thread/player/playerglobal/flash/profiler/Telemetry.js +25 -0
- package/dist/thread/player/playerglobal/flash/sensors/Accelerometer.js +12 -0
- package/dist/thread/player/playerglobal/flash/system/ApplicationDomain.js +69 -0
- package/dist/thread/player/playerglobal/flash/system/Capabilities.js +163 -0
- package/dist/thread/player/playerglobal/flash/system/FSCommandHost.js +17 -0
- package/dist/thread/player/playerglobal/flash/system/Security.js +46 -0
- package/dist/thread/player/playerglobal/flash/system/SecurityDomain.js +21 -0
- package/dist/thread/player/playerglobal/flash/system/System.js +73 -0
- package/dist/thread/player/playerglobal/flash/system/Worker.js +112 -0
- package/dist/thread/player/playerglobal/flash/text/Font.js +95 -0
- package/dist/thread/player/playerglobal/flash/text/StaticText.js +16 -0
- package/dist/thread/player/playerglobal/flash/text/StyleSheet.js +65 -0
- package/dist/thread/player/playerglobal/flash/text/TextField.js +707 -0
- package/dist/thread/player/playerglobal/flash/text/TextRenderer.js +77 -0
- package/dist/thread/player/playerglobal/flash/text/engine/FontDescription.js +141 -0
- package/dist/thread/player/playerglobal/flash/text/engine/TabStop.js +46 -0
- package/dist/thread/player/playerglobal/flash/trace/Trace.js +17 -0
- package/dist/thread/player/playerglobal/flash/ui/ContextMenu.js +17 -0
- package/dist/thread/player/playerglobal/flash/ui/GameInput.js +19 -0
- package/dist/thread/player/playerglobal/flash/ui/Keyboard.js +27 -0
- package/dist/thread/player/playerglobal/flash/ui/Mouse.js +127 -0
- package/dist/thread/player/playerglobal/flash/ui/Multitouch.js +46 -0
- package/dist/thread/player/playerglobal/flash/utils/ByteArray.js +155 -0
- package/dist/thread/player/playerglobal/flash/utils/Timer.js +25 -0
- package/dist/thread/player/playerglobal/flash/xml/XMLDocument.js +74 -0
- package/dist/thread/player/playerglobal/index.js +224 -0
- package/dist/thread/player/playerglobal/libraries.js +10 -0
- package/dist/thread/player/playerglobal/playerglobal-library.js +22 -0
- package/dist/thread/player/playerglobal/toplevel.js +122 -0
- package/dist/thread/player/scripting/clipboard.js +146 -0
- package/dist/thread/player/scripting/code.js +900 -0
- package/dist/thread/player/scripting/evaluate.js +144 -0
- package/dist/thread/player/scripting/events.js +172 -0
- package/dist/thread/player/scripting/handover.js +182 -0
- package/dist/thread/player/scripting/lazy.js +38 -0
- package/dist/thread/player/scripting/lifecycle.js +272 -0
- package/dist/thread/player/scripting/loads.js +860 -0
- package/dist/thread/player/scripting/sha256.js +95 -0
- package/dist/thread/player/scripting/symbols.js +348 -0
- package/dist/thread/player/scripting/timers.js +434 -0
- package/dist/thread/player/scripting/workers.js +923 -0
- package/dist/thread/player/scripting.js +1018 -0
- package/dist/thread/player/stage.js +4 -0
- package/dist/thread/player/text/csm.js +113 -0
- package/dist/thread/player/text/css.js +167 -0
- package/dist/thread/player/text/fonts.js +97 -0
- package/dist/thread/player/text/layout.js +393 -0
- package/dist/thread/player/text/static.js +109 -0
- package/dist/thread/player/text/text.js +431 -0
- package/dist/thread/player/workers/thread.js +159 -0
- package/dist/thread/player/workers/wire.js +198 -0
- package/dist/thread/player-hosts/web-worker.js +19 -0
- package/dist/thread/runtime/avm1/activation.js +89 -0
- package/dist/thread/runtime/avm1/case.js +249 -0
- package/dist/thread/runtime/avm1/clips.js +334 -0
- package/dist/thread/runtime/avm1/control.js +280 -0
- package/dist/thread/runtime/avm1/errors.js +50 -0
- package/dist/thread/runtime/avm1/functions.js +249 -0
- package/dist/thread/runtime/avm1/globals/array.js +549 -0
- package/dist/thread/runtime/avm1/globals/broadcaster.js +131 -0
- package/dist/thread/runtime/avm1/globals/date.js +436 -0
- package/dist/thread/runtime/avm1/globals/global.js +344 -0
- package/dist/thread/runtime/avm1/globals/math.js +139 -0
- package/dist/thread/runtime/avm1/globals/number.js +93 -0
- package/dist/thread/runtime/avm1/globals/string.js +201 -0
- package/dist/thread/runtime/avm1/globals/timers.js +129 -0
- package/dist/thread/runtime/avm1/host.js +5 -0
- package/dist/thread/runtime/avm1/index.js +14 -0
- package/dist/thread/runtime/avm1/inheritance.js +132 -0
- package/dist/thread/runtime/avm1/numbers.js +298 -0
- package/dist/thread/runtime/avm1/objects.js +896 -0
- package/dist/thread/runtime/avm1/operators.js +170 -0
- package/dist/thread/runtime/avm1/realm.js +529 -0
- package/dist/thread/runtime/avm1/runtime.js +882 -0
- package/dist/thread/runtime/avm1/scope.js +385 -0
- package/dist/thread/runtime/avm1/urls.js +180 -0
- package/dist/thread/runtime/avm1/values.js +97 -0
- package/dist/thread/runtime/avm2/amf-classes.js +66 -0
- package/dist/thread/runtime/avm2/amf.js +801 -0
- package/dist/thread/runtime/avm2/array-conversion.js +100 -0
- package/dist/thread/runtime/avm2/builtin-library.js +21 -0
- package/dist/thread/runtime/avm2/cache-fill.js +86 -0
- package/dist/thread/runtime/avm2/classes.js +211 -0
- package/dist/thread/runtime/avm2/definitions.js +69 -0
- package/dist/thread/runtime/avm2/descriptors.js +5 -0
- package/dist/thread/runtime/avm2/dictionary-keys.js +295 -0
- package/dist/thread/runtime/avm2/domain-memory.js +75 -0
- package/dist/thread/runtime/avm2/domain.js +280 -0
- package/dist/thread/runtime/avm2/dynamic-properties.js +182 -0
- package/dist/thread/runtime/avm2/enumeration.js +393 -0
- package/dist/thread/runtime/avm2/errors.js +45 -0
- package/dist/thread/runtime/avm2/float-library.js +66 -0
- package/dist/thread/runtime/avm2/float.js +26 -0
- package/dist/thread/runtime/avm2/hooks.js +19 -0
- package/dist/thread/runtime/avm2/index.js +38 -0
- package/dist/thread/runtime/avm2/messages.js +177 -0
- package/dist/thread/runtime/avm2/method-factories.js +95 -0
- package/dist/thread/runtime/avm2/modules.js +105 -0
- package/dist/thread/runtime/avm2/names.js +248 -0
- package/dist/thread/runtime/avm2/natives/aliases.js +47 -0
- package/dist/thread/runtime/avm2/natives/array.js +390 -0
- package/dist/thread/runtime/avm2/natives/bytearray.js +1227 -0
- package/dist/thread/runtime/avm2/natives/case.js +88 -0
- package/dist/thread/runtime/avm2/natives/concurrent.js +199 -0
- package/dist/thread/runtime/avm2/natives/date.js +581 -0
- package/dist/thread/runtime/avm2/natives/define.js +130 -0
- package/dist/thread/runtime/avm2/natives/describe.js +351 -0
- package/dist/thread/runtime/avm2/natives/dictionary.js +12 -0
- package/dist/thread/runtime/avm2/natives/float-vector.js +81 -0
- package/dist/thread/runtime/avm2/natives/float.js +96 -0
- package/dist/thread/runtime/avm2/natives/index.js +64 -0
- package/dist/thread/runtime/avm2/natives/json.js +514 -0
- package/dist/thread/runtime/avm2/natives/number.js +162 -0
- package/dist/thread/runtime/avm2/natives/object.js +237 -0
- package/dist/thread/runtime/avm2/natives/proxy.js +75 -0
- package/dist/thread/runtime/avm2/natives/regexp.js +485 -0
- package/dist/thread/runtime/avm2/natives/shell-workers.js +404 -0
- package/dist/thread/runtime/avm2/natives/shell.js +557 -0
- package/dist/thread/runtime/avm2/natives/sort.js +377 -0
- package/dist/thread/runtime/avm2/natives/string.js +132 -0
- package/dist/thread/runtime/avm2/natives/sync.js +821 -0
- package/dist/thread/runtime/avm2/natives/toplevel.js +139 -0
- package/dist/thread/runtime/avm2/natives/vector-elements.js +46 -0
- package/dist/thread/runtime/avm2/natives/vector.js +406 -0
- package/dist/thread/runtime/avm2/natives/xml/access.js +633 -0
- package/dist/thread/runtime/avm2/natives/xml/build.js +291 -0
- package/dist/thread/runtime/avm2/natives/xml/chars.js +112 -0
- package/dist/thread/runtime/avm2/natives/xml/escape.js +38 -0
- package/dist/thread/runtime/avm2/natives/xml/names.js +204 -0
- package/dist/thread/runtime/avm2/natives/xml/node.js +272 -0
- package/dist/thread/runtime/avm2/natives/xml/operators.js +69 -0
- package/dist/thread/runtime/avm2/natives/xml/parser.js +356 -0
- package/dist/thread/runtime/avm2/natives/xml/strings.js +191 -0
- package/dist/thread/runtime/avm2/natives/xml/values.js +122 -0
- package/dist/thread/runtime/avm2/natives/xml/xml.js +645 -0
- package/dist/thread/runtime/avm2/number-strings.js +110 -0
- package/dist/thread/runtime/avm2/numbers.js +558 -0
- package/dist/thread/runtime/avm2/options.js +16 -0
- package/dist/thread/runtime/avm2/player-messages.js +550 -0
- package/dist/thread/runtime/avm2/property-cache.js +135 -0
- package/dist/thread/runtime/avm2/runtime.js +2644 -0
- package/dist/thread/runtime/avm2/traits.js +509 -0
- package/dist/thread/runtime/index.js +7 -0
- package/dist/web-worker.d.ts +2 -0
- package/dist/web-worker.d.ts.map +1 -0
- package/dist/web-worker.js +20 -0
- package/dist/web-worker.js.map +1 -0
- package/dist/websocket.d.ts +4 -0
- package/dist/websocket.d.ts.map +1 -0
- package/dist/websocket.js +27 -0
- package/dist/websocket.js.map +1 -0
- package/dist/workers.d.ts +35 -0
- package/dist/workers.d.ts.map +1 -0
- package/dist/workers.js +171 -0
- package/dist/workers.js.map +1 -0
- package/package.json +62 -3
- package/src/indexeddb.ts +227 -0
- package/src/node-worker.ts +13 -0
- package/src/node.ts +49 -0
- package/src/precompiled.ts +166 -0
- package/src/stage3d.ts +76 -0
- package/src/web-worker.ts +24 -0
- package/src/websocket.ts +32 -0
- package/src/workers.ts +255 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// String case mapping as avmplus does it: unit by unit, from Unicode tables
|
|
2
|
+
// older than JavaScript's, so a unit never maps to more than one and never
|
|
3
|
+
// by context (no final sigma), and a surrogate pair keeps its case.
|
|
4
|
+
// Where avmplus' mapping of a unit differs from JavaScript's, as the
|
|
5
|
+
// oracle's avmshell maps each of the 65536: runs of [first unit, count,
|
|
6
|
+
// stride, what to add to each], most of them 0, a unit avmplus leaves as it is.
|
|
7
|
+
const UPPER = [
|
|
8
|
+
181, 1, 1, 0, 223, 1, 1, 0, 329, 1, 1, 0, 384, 1, 1, 0, 410, 2, 1, 0, 414, 1, 1, 0, 496, 1, 1, 0,
|
|
9
|
+
572, 1, 1, 0, 575, 2, 1, 0, 578, 1, 1, 0, 583, 5, 2, 0, 592, 3, 1, 0, 604, 1, 1, 0, 609, 1, 1, 0,
|
|
10
|
+
612, 3, 1, 0, 618, 3, 1, 0, 625, 1, 1, 0, 637, 1, 1, 0, 642, 1, 1, 0, 647, 2, 2, 0, 652, 1, 1, 0,
|
|
11
|
+
669, 2, 1, 0, 881, 2, 2, 0, 887, 1, 1, 0, 891, 3, 1, 0, 912, 1, 1, 0, 944, 1, 1, 0, 962, 1, 1,
|
|
12
|
+
-32, 983, 1, 1, 0, 1010, 1, 1, -79, 1011, 1, 1, 0, 1016, 1, 1, 0, 1019, 1, 1, 0, 1222, 1, 1, 0,
|
|
13
|
+
1226, 1, 1, 0, 1230, 2, 1, 0, 1275, 27, 2, 0, 1415, 1, 1, 0, 4304, 43, 1, 0, 4349, 3, 1, 0, 5112,
|
|
14
|
+
6, 1, 0, 7296, 9, 1, 0, 7306, 1, 1, 0, 7545, 1, 1, 0, 7549, 1, 1, 0, 7566, 1, 1, 0, 7830, 5, 1, 0,
|
|
15
|
+
7931, 3, 2, 0, 8016, 4, 2, 0, 8064, 8, 1, 8, 8072, 8, 1, 0, 8080, 8, 1, 8, 8088, 8, 1, 0, 8096, 8,
|
|
16
|
+
1, 8, 8104, 8, 1, 0, 8114, 1, 1, 0, 8115, 1, 1, 9, 8116, 2, 2, 0, 8119, 1, 1, 0, 8124, 1, 1, 0,
|
|
17
|
+
8130, 1, 1, 0, 8131, 1, 1, 9, 8132, 2, 2, 0, 8135, 1, 1, 0, 8140, 1, 1, 0, 8146, 2, 1, 0, 8150, 2,
|
|
18
|
+
1, 0, 8162, 3, 1, 0, 8166, 2, 1, 0, 8178, 1, 1, 0, 8179, 1, 1, 9, 8180, 2, 2, 0, 8183, 1, 1, 0,
|
|
19
|
+
8188, 1, 1, 0, 8526, 1, 1, 0, 8580, 1, 1, 0, 11312, 48, 1, 0, 11361, 1, 1, 0, 11365, 2, 1, 0,
|
|
20
|
+
11368, 3, 2, 0, 11379, 1, 1, 0, 11382, 1, 1, 0, 11393, 50, 2, 0, 11500, 2, 2, 0, 11507, 1, 1, 0,
|
|
21
|
+
11520, 38, 1, 0, 11559, 1, 1, 0, 11565, 1, 1, 0, 42561, 23, 2, 0, 42625, 14, 2, 0, 42787, 7, 2, 0,
|
|
22
|
+
42803, 31, 2, 0, 42874, 2, 2, 0, 42879, 5, 2, 0, 42892, 1, 1, 0, 42897, 2, 2, 0, 42900, 1, 1, 0,
|
|
23
|
+
42903, 10, 2, 0, 42933, 8, 2, 0, 42952, 2, 2, 0, 42957, 8, 2, 0, 42998, 1, 1, 0, 43859, 1, 1, 0,
|
|
24
|
+
43888, 80, 1, 0, 64256, 7, 1, 0, 64275, 5, 1, 0,
|
|
25
|
+
];
|
|
26
|
+
const LOWER = [
|
|
27
|
+
304, 1, 1, -199, 544, 1, 1, 0, 570, 2, 1, 0, 573, 2, 1, 0, 577, 2, 2, 0, 580, 3, 1, 0, 584, 4, 2,
|
|
28
|
+
0, 880, 2, 2, 0, 886, 1, 1, 0, 895, 1, 1, 0, 930, 1, 1, 32, 975, 1, 1, 0, 1015, 2, 2, 0, 1018, 1,
|
|
29
|
+
1, 0, 1021, 3, 1, 0, 1216, 1, 1, 0, 1221, 1, 1, 0, 1225, 1, 1, 0, 1229, 1, 1, 0, 1274, 27, 2, 0,
|
|
30
|
+
4256, 38, 1, 48, 4295, 1, 1, 0, 4301, 1, 1, 0, 5024, 86, 1, 0, 7305, 1, 1, 0, 7312, 43, 1, 0,
|
|
31
|
+
7357, 3, 1, 0, 7838, 1, 1, 0, 7930, 3, 2, 0, 8498, 1, 1, 0, 8579, 1, 1, 0, 11264, 48, 1, 0, 11360,
|
|
32
|
+
2, 2, 0, 11363, 2, 1, 0, 11367, 4, 2, 0, 11374, 3, 1, 0, 11378, 1, 1, 0, 11381, 1, 1, 0, 11390, 3,
|
|
33
|
+
1, 0, 11394, 49, 2, 0, 11499, 2, 2, 0, 11506, 1, 1, 0, 42560, 23, 2, 0, 42624, 14, 2, 0, 42786, 7,
|
|
34
|
+
2, 0, 42802, 31, 2, 0, 42873, 3, 2, 0, 42878, 5, 2, 0, 42891, 2, 2, 0, 42896, 2, 2, 0, 42902, 11,
|
|
35
|
+
2, 0, 42923, 4, 1, 0, 42928, 5, 1, 0, 42934, 8, 2, 0, 42949, 3, 1, 0, 42953, 2, 2, 0, 42956, 9, 2,
|
|
36
|
+
0, 42997, 1, 1, 0,
|
|
37
|
+
];
|
|
38
|
+
// Below the first unit either table names, JavaScript maps a string as avmplus does.
|
|
39
|
+
const PLAIN = /^[\0-\xb4]*$/;
|
|
40
|
+
let upper;
|
|
41
|
+
let lower;
|
|
42
|
+
function table(runs) {
|
|
43
|
+
const t = new Map();
|
|
44
|
+
for (let i = 0; i < runs.length; i += 4) {
|
|
45
|
+
for (let k = 0; k < runs[i + 1]; k++) {
|
|
46
|
+
const c = runs[i] + k * runs[i + 2];
|
|
47
|
+
t.set(c, c + runs[i + 3]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return t;
|
|
51
|
+
}
|
|
52
|
+
function map(s, t, js) {
|
|
53
|
+
const out = [];
|
|
54
|
+
for (let i = 0; i < s.length; i++) {
|
|
55
|
+
const c = s.charCodeAt(i);
|
|
56
|
+
const m = t.get(c);
|
|
57
|
+
if (m !== undefined) {
|
|
58
|
+
out.push(m);
|
|
59
|
+
}
|
|
60
|
+
else if (c >= 0xd800 && c <= 0xdfff) {
|
|
61
|
+
out.push(c);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
out.push(js(String.fromCharCode(c)).charCodeAt(0));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const parts = [];
|
|
68
|
+
for (let i = 0; i < out.length; i += 0x1000) {
|
|
69
|
+
parts.push(String.fromCharCode(...out.slice(i, i + 0x1000)));
|
|
70
|
+
}
|
|
71
|
+
return parts.join("");
|
|
72
|
+
}
|
|
73
|
+
/** String::toUpperCase. */
|
|
74
|
+
export function upperCase(s) {
|
|
75
|
+
if (PLAIN.test(s)) {
|
|
76
|
+
return s.toUpperCase();
|
|
77
|
+
}
|
|
78
|
+
upper ??= table(UPPER);
|
|
79
|
+
return map(s, upper, (c) => c.toUpperCase());
|
|
80
|
+
}
|
|
81
|
+
/** String::toLowerCase. */
|
|
82
|
+
export function lowerCase(s) {
|
|
83
|
+
if (PLAIN.test(s)) {
|
|
84
|
+
return s.toLowerCase();
|
|
85
|
+
}
|
|
86
|
+
lower ??= table(LOWER);
|
|
87
|
+
return map(s, lower, (c) => c.toLowerCase());
|
|
88
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// flash.concurrent's Mutex and Condition, as avmplus' ConcurrencyGlue, over
|
|
2
|
+
// the memory a primordial's workers share (sync.ts): a Mutex or a Condition
|
|
3
|
+
// is an address in it, the same in every worker, and each VM keeps one
|
|
4
|
+
// object for each, as avmplus interns one for its State. And
|
|
5
|
+
// avm2.intrinsics.memory's compare and swap. Crossbridge uses them all on
|
|
6
|
+
// startup whether or not it starts workers.
|
|
7
|
+
import { bytesOf } from "./bytearray.js";
|
|
8
|
+
import { plain, registerNativeClass } from "./define.js";
|
|
9
|
+
import { newSyncMemory, Sync, SyncFull, SyncTimeout } from "./sync.js";
|
|
10
|
+
const vmSyncs = new WeakMap();
|
|
11
|
+
function vmSync(rt) {
|
|
12
|
+
let vm = vmSyncs.get(rt);
|
|
13
|
+
if (!vm) {
|
|
14
|
+
const init = rt.syncInit;
|
|
15
|
+
const sync = init
|
|
16
|
+
? new Sync(init.memory, init.thread, init)
|
|
17
|
+
: rt.workerInit
|
|
18
|
+
? // A refused avmshell worker's code ends: its runShell stops.
|
|
19
|
+
new Sync(rt.workerInit.memory.sync, rt.workerInit.id, { selfEnds: true })
|
|
20
|
+
: new Sync(newSyncMemory(), 0);
|
|
21
|
+
vm = { sync, objects: new Map() };
|
|
22
|
+
vmSyncs.set(rt, vm);
|
|
23
|
+
}
|
|
24
|
+
return vm;
|
|
25
|
+
}
|
|
26
|
+
/** The shared memory as `rt` sees it: its own, or that of the primordial whose worker it runs. */
|
|
27
|
+
export function syncOf(rt) {
|
|
28
|
+
return vmSync(rt).sync;
|
|
29
|
+
}
|
|
30
|
+
/** The address of a Mutex or a Condition; null for anything else. */
|
|
31
|
+
export function syncRef(value) {
|
|
32
|
+
if (value === null || typeof value !== "object") {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const o = value;
|
|
36
|
+
if (typeof o.$mutex === "number") {
|
|
37
|
+
return { kind: "mutex", address: o.$mutex };
|
|
38
|
+
}
|
|
39
|
+
if (typeof o.$condition === "number") {
|
|
40
|
+
return { kind: "condition", address: o.$condition };
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
/** This VM's one Mutex or Condition for `ref`, made without running its constructor. */
|
|
45
|
+
export function syncObject(rt, ref) {
|
|
46
|
+
const { objects } = vmSync(rt);
|
|
47
|
+
const known = objects.get(ref.address)?.deref();
|
|
48
|
+
if (known) {
|
|
49
|
+
return known;
|
|
50
|
+
}
|
|
51
|
+
const name = ref.kind === "mutex" ? "flash.concurrent::Mutex" : "flash.concurrent::Condition";
|
|
52
|
+
const o = rt.classNamed(name).$it.instance();
|
|
53
|
+
if (ref.kind === "mutex") {
|
|
54
|
+
o.$mutex = ref.address;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
o.$condition = ref.address;
|
|
58
|
+
o.$mutexObject = null;
|
|
59
|
+
}
|
|
60
|
+
objects.set(ref.address, new WeakRef(o));
|
|
61
|
+
return o;
|
|
62
|
+
}
|
|
63
|
+
/** An error of class `name`, or a plain Error where the VM has no such class, as avmshell has none of flash.errors'. */
|
|
64
|
+
function errorOf(rt, name, id) {
|
|
65
|
+
let cls;
|
|
66
|
+
try {
|
|
67
|
+
cls = rt.classNamed(name);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
cls = undefined;
|
|
71
|
+
}
|
|
72
|
+
return rt.error(cls ? name : "Error", id);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* What a script gets for what the sync memory threw: Flash's script
|
|
76
|
+
* timeout (1502) for a lock or wait that spun too long on the primordial,
|
|
77
|
+
* MemoryError 1000 where the memory is full; anything else as it is, as a
|
|
78
|
+
* terminated worker's SyncTerminated, which no script catches.
|
|
79
|
+
*/
|
|
80
|
+
export function syncError(rt, e) {
|
|
81
|
+
if (e instanceof SyncTimeout) {
|
|
82
|
+
return errorOf(rt, "flash.errors::ScriptTimeoutError", 1502);
|
|
83
|
+
}
|
|
84
|
+
if (e instanceof SyncFull) {
|
|
85
|
+
return errorOf(rt, "flash.errors::MemoryError", 1000);
|
|
86
|
+
}
|
|
87
|
+
return e;
|
|
88
|
+
}
|
|
89
|
+
export function concurrentNatives(rt) {
|
|
90
|
+
const natives = {};
|
|
91
|
+
const blocking = (f) => {
|
|
92
|
+
try {
|
|
93
|
+
return f();
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
throw syncError(rt, e);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
class MutexNatives {
|
|
100
|
+
static get isSupported() {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
"flash.concurrent:Mutex::ctor"() {
|
|
104
|
+
const vm = vmSync(rt);
|
|
105
|
+
this.$mutex = blocking(() => vm.sync.newMutex());
|
|
106
|
+
vm.objects.set(this.$mutex, new WeakRef(this));
|
|
107
|
+
}
|
|
108
|
+
lock() {
|
|
109
|
+
blocking(() => syncOf(rt).lock(this.$mutex));
|
|
110
|
+
}
|
|
111
|
+
tryLock() {
|
|
112
|
+
return blocking(() => syncOf(rt).tryLock(this.$mutex));
|
|
113
|
+
}
|
|
114
|
+
unlock() {
|
|
115
|
+
if (!syncOf(rt).unlock(this.$mutex)) {
|
|
116
|
+
throw rt.error("flash.errors::IllegalOperationError", 1514);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
class ConditionNatives {
|
|
121
|
+
static get isSupported() {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
"flash.concurrent:Condition::ctor"(mutex) {
|
|
125
|
+
if (mutex === null || mutex === undefined) {
|
|
126
|
+
throw rt.error("ArgumentError", 2007, "mutex");
|
|
127
|
+
}
|
|
128
|
+
const vm = vmSync(rt);
|
|
129
|
+
this.$mutexObject = mutex;
|
|
130
|
+
this.$condition = blocking(() => vm.sync.newCondition(mutex.$mutex));
|
|
131
|
+
vm.objects.set(this.$condition, new WeakRef(this));
|
|
132
|
+
}
|
|
133
|
+
// As ConditionObject::get_mutex: one that crossed from another worker
|
|
134
|
+
// finds its Mutex in this VM, or makes it.
|
|
135
|
+
get mutex() {
|
|
136
|
+
const self = this;
|
|
137
|
+
if (!self.$mutexObject) {
|
|
138
|
+
const address = syncOf(rt).conditionMutex(self.$condition);
|
|
139
|
+
self.$mutexObject = syncObject(rt, { kind: "mutex", address });
|
|
140
|
+
}
|
|
141
|
+
return self.$mutexObject;
|
|
142
|
+
}
|
|
143
|
+
// As ConditionObject::wait: true when the time ran out, false when
|
|
144
|
+
// notified, and false for a wait without a timeout (-1), which only a
|
|
145
|
+
// notify ends.
|
|
146
|
+
wait(timeout) {
|
|
147
|
+
// Left out, it is the declared -1, which a native is not given.
|
|
148
|
+
const t = timeout === undefined ? -1 : rt.toNumber(timeout);
|
|
149
|
+
if (t < 0 && t !== -1) {
|
|
150
|
+
throw rt.error("ArgumentError", 1515);
|
|
151
|
+
}
|
|
152
|
+
const sync = syncOf(rt);
|
|
153
|
+
if (!sync.holds(sync.conditionMutex(this.$condition))) {
|
|
154
|
+
throw rt.error("flash.errors::IllegalOperationError", 1518);
|
|
155
|
+
}
|
|
156
|
+
const ms = t === -1 ? -1 : Number.isNaN(t) ? 0 : Math.min(Math.ceil(t), 0x7fffffff);
|
|
157
|
+
return blocking(() => sync.wait(this.$condition, ms));
|
|
158
|
+
}
|
|
159
|
+
notify() {
|
|
160
|
+
const sync = syncOf(rt);
|
|
161
|
+
if (!sync.holds(sync.conditionMutex(this.$condition))) {
|
|
162
|
+
throw rt.error("flash.errors::IllegalOperationError", 1516);
|
|
163
|
+
}
|
|
164
|
+
blocking(() => sync.notify(this.$condition, false));
|
|
165
|
+
}
|
|
166
|
+
notifyAll() {
|
|
167
|
+
const sync = syncOf(rt);
|
|
168
|
+
if (!sync.holds(sync.conditionMutex(this.$condition))) {
|
|
169
|
+
throw rt.error("flash.errors::IllegalOperationError", 1517);
|
|
170
|
+
}
|
|
171
|
+
blocking(() => sync.notify(this.$condition, true));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// As ConcurrentMemory::casi32: the domain memory's int at a word-aligned
|
|
175
|
+
// address replaced by `next` if it is `expected`; the int there before.
|
|
176
|
+
// Atomic where another worker shares the memory.
|
|
177
|
+
natives["avm2.intrinsics.memory::casi32"] = plain((address, expected, next) => {
|
|
178
|
+
const at = rt.toInt(address);
|
|
179
|
+
const outside = () => at % 4 !== 0 || rt.memoryLength < 4 || at >>> 0 > rt.memoryLength - 4;
|
|
180
|
+
if (outside()) {
|
|
181
|
+
rt.refreshMemory?.();
|
|
182
|
+
if (outside()) {
|
|
183
|
+
throw rt.error("RangeError", 1506);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (rt.refreshMemory && rt.memoryProvider) {
|
|
187
|
+
return bytesOf(rt, rt.memoryProvider).compareAndSwapInt(at, rt.toInt(expected), rt.toInt(next));
|
|
188
|
+
}
|
|
189
|
+
const previous = rt.memory.getInt32(at, true);
|
|
190
|
+
if (previous === rt.toInt(expected)) {
|
|
191
|
+
rt.memory.setInt32(at, rt.toInt(next), true);
|
|
192
|
+
}
|
|
193
|
+
return previous;
|
|
194
|
+
});
|
|
195
|
+
natives["avm2.intrinsics.memory::mfence"] = plain(() => { });
|
|
196
|
+
registerNativeClass(natives, "flash.concurrent::Mutex", MutexNatives);
|
|
197
|
+
registerNativeClass(natives, "flash.concurrent::Condition", ConditionNatives);
|
|
198
|
+
return natives;
|
|
199
|
+
}
|