@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,122 @@
|
|
|
1
|
+
/** "pkg.Name" or "pkg::Name" as "pkg::Name", as getDefinitionByName takes either. */
|
|
2
|
+
function qualify(name) {
|
|
3
|
+
if (name.includes("::")) {
|
|
4
|
+
return name;
|
|
5
|
+
}
|
|
6
|
+
const i = name.lastIndexOf(".");
|
|
7
|
+
return i < 0 ? name : `${name.slice(0, i)}::${name.slice(i + 1)}`;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What `name` names in `domain`, as getDefinitionByName and
|
|
11
|
+
* ApplicationDomain's lookups take a name: "pkg.Name" or "pkg::Name", or a
|
|
12
|
+
* Vector, "Vector.<T>" with or without its package, T named either way or
|
|
13
|
+
* a Vector too; `find` looks a plain name up. As Flash's, T is looked up
|
|
14
|
+
* as any definition, * among those not defined (#1065), and one that is
|
|
15
|
+
* not a class makes the Vector corrupt: what `notAClass` gives, by default
|
|
16
|
+
* VerifyError #1107, which hasDefinition counts as defined instead.
|
|
17
|
+
*/
|
|
18
|
+
export function definitionNamed(rt, name, find, notAClass = () => {
|
|
19
|
+
throw rt.error("VerifyError", 1107);
|
|
20
|
+
}) {
|
|
21
|
+
const vector = /^(?:__AS3__\.vec(?:::|\.))?Vector\.<(.+)>$/.exec(name);
|
|
22
|
+
if (vector) {
|
|
23
|
+
const param = definitionNamed(rt, vector[1], find, notAClass);
|
|
24
|
+
return param?.$it ? rt.applyType(rt.classNamed("__AS3__.vec::Vector"), [param]) : notAClass();
|
|
25
|
+
}
|
|
26
|
+
return find(qualify(name));
|
|
27
|
+
}
|
|
28
|
+
const UTF8 = new TextEncoder();
|
|
29
|
+
export function toplevelNatives(s) {
|
|
30
|
+
return {
|
|
31
|
+
trace: (rt) => (...args) => {
|
|
32
|
+
rt.print(args.map((v) => rt.toString(v)).join(" "));
|
|
33
|
+
},
|
|
34
|
+
// Looked up in the domain of the code that asks, as Flash's.
|
|
35
|
+
"flash.utils::getDefinitionByName": (rt) => (name) => definitionNamed(rt, rt.toString(name), (q) => rt.definitionNamed(q, s.code.codeDomain())),
|
|
36
|
+
// The alias registerClassAlias gave the value's class, which describeType writes; null for none.
|
|
37
|
+
"flash.utils::getAliasName": (rt) => (v) => {
|
|
38
|
+
if (v === null || v === undefined) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const alias = rt.aliasOf(v.$it ? v.$it : rt.traitsOf(v));
|
|
42
|
+
return alias === "" ? null : alias;
|
|
43
|
+
},
|
|
44
|
+
// Milliseconds since the start, by the host's real clock or the frame clock (Timers.timer).
|
|
45
|
+
"flash.utils::getTimer": () => () => s.timers.timer(),
|
|
46
|
+
"flash.utils::escapeMultiByte": (rt) => (text) => escapeMultiByte(rt.toString(text)),
|
|
47
|
+
"flash.utils::unescapeMultiByte": (rt) => (text) => unescapeMultiByte(rt.toString(text)),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Every byte of the UTF-8 but the alphanumerics as %XX, up to a NUL; a lone surrogate is U+FFFD, as the encoder has it. */
|
|
51
|
+
function escapeMultiByte(text) {
|
|
52
|
+
const nul = text.indexOf("\0");
|
|
53
|
+
const bytes = UTF8.encode(nul < 0 ? text : text.slice(0, nul));
|
|
54
|
+
let out = "";
|
|
55
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
56
|
+
const b = bytes[i];
|
|
57
|
+
const alphanumeric = (b >= 0x30 && b <= 0x39) || (b >= 0x41 && b <= 0x5a) || (b >= 0x61 && b <= 0x7a);
|
|
58
|
+
out += alphanumeric
|
|
59
|
+
? String.fromCharCode(b)
|
|
60
|
+
: `%${b.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
const HEX = /^[0-9a-fA-F]$/;
|
|
65
|
+
/**
|
|
66
|
+
* The bytes of %XX escapes and the rest as given, up to a NUL not behind a
|
|
67
|
+
* %, decoded as UTF-8 the lenient way: a % takes the next character, and
|
|
68
|
+
* one more if the first is a hex digit, and gives a byte only when both
|
|
69
|
+
* are; an encoded surrogate stands; an incomplete or invalid sequence
|
|
70
|
+
* leaves its bytes as characters of their own.
|
|
71
|
+
*/
|
|
72
|
+
function unescapeMultiByte(text) {
|
|
73
|
+
const bytes = [];
|
|
74
|
+
for (let i = 0; i < text.length;) {
|
|
75
|
+
const c = text[i++];
|
|
76
|
+
if (c === "\0") {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
if (c !== "%") {
|
|
80
|
+
for (const b of UTF8.encode(c)) {
|
|
81
|
+
bytes.push(b);
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const first = text[i++];
|
|
86
|
+
if (first === undefined || !HEX.test(first)) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const second = text[i++];
|
|
90
|
+
if (second !== undefined && HEX.test(second)) {
|
|
91
|
+
bytes.push(Number.parseInt(first + second, 16));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
let out = "";
|
|
95
|
+
for (let i = 0; i < bytes.length;) {
|
|
96
|
+
const b = bytes[i];
|
|
97
|
+
const length = b < 0x80
|
|
98
|
+
? 1
|
|
99
|
+
: b >= 0xc0 && b < 0xe0
|
|
100
|
+
? 2
|
|
101
|
+
: b >= 0xe0 && b < 0xf0
|
|
102
|
+
? 3
|
|
103
|
+
: b >= 0xf0 && b < 0xf8
|
|
104
|
+
? 4
|
|
105
|
+
: 0;
|
|
106
|
+
let code = length === 1 ? b : length === 2 ? b & 0x1f : length === 3 ? b & 0x0f : b & 0x07;
|
|
107
|
+
let ok = length > 0 && i + length <= bytes.length;
|
|
108
|
+
for (let k = 1; ok && k < length; k++) {
|
|
109
|
+
const next = bytes[i + k];
|
|
110
|
+
ok = (next & 0xc0) === 0x80;
|
|
111
|
+
code = (code << 6) | (next & 0x3f);
|
|
112
|
+
}
|
|
113
|
+
if (!ok) {
|
|
114
|
+
out += String.fromCharCode(b);
|
|
115
|
+
i++;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
out += String.fromCodePoint(code);
|
|
119
|
+
i += length;
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/** ClipboardFormats.TEXT_FORMAT and HTML_FORMAT, the formats a browser's clipboard carries too. */
|
|
2
|
+
export const TEXT = "air:text";
|
|
3
|
+
export const HTML = "air:html";
|
|
4
|
+
export class Clipboard {
|
|
5
|
+
host;
|
|
6
|
+
/**
|
|
7
|
+
* What it holds, by native name: "air:text", "air:html", "air:rtf" and
|
|
8
|
+
* "air:url", and a script's own formats as "air:reference:" and
|
|
9
|
+
* "air:serialization:" and the name.
|
|
10
|
+
*/
|
|
11
|
+
contents = new Map();
|
|
12
|
+
/**
|
|
13
|
+
* Clipboard.setDataHandler's handlers, by native name, each run once
|
|
14
|
+
* when its format is first read, and storing its data as it runs.
|
|
15
|
+
*/
|
|
16
|
+
handlers = new Map();
|
|
17
|
+
/** A handler storing its data, which leaves the other handlers be. */
|
|
18
|
+
storing = false;
|
|
19
|
+
/** Moves with every write, so a gesture or a copy can tell whether a script wrote. */
|
|
20
|
+
version = 0;
|
|
21
|
+
gestures = 0;
|
|
22
|
+
pastes = 0;
|
|
23
|
+
/** Inside a copy or cut whose event carries the data to the system, which then needs no write of its own. */
|
|
24
|
+
collecting = 0;
|
|
25
|
+
constructor(host) {
|
|
26
|
+
this.host = host;
|
|
27
|
+
}
|
|
28
|
+
/** Whether a script may write now: while a user's event is handled. */
|
|
29
|
+
get writable() {
|
|
30
|
+
return this.gestures > 0;
|
|
31
|
+
}
|
|
32
|
+
/** Whether a script may read now: while a paste is handled. */
|
|
33
|
+
get readable() {
|
|
34
|
+
return this.pastes > 0;
|
|
35
|
+
}
|
|
36
|
+
/** The text, and HTML if any, that goes to the system's clipboard. */
|
|
37
|
+
get data() {
|
|
38
|
+
const text = this.get(TEXT);
|
|
39
|
+
const html = this.get(HTML);
|
|
40
|
+
return {
|
|
41
|
+
text: typeof text === "string" ? text : "",
|
|
42
|
+
...(typeof html === "string" ? { html } : {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** The formats it holds, by native name, those a handler will give too. */
|
|
46
|
+
get formats() {
|
|
47
|
+
return [...new Set([...this.contents.keys(), ...this.handlers.keys()])];
|
|
48
|
+
}
|
|
49
|
+
/** What `format` holds, after its handler, if any, has run. */
|
|
50
|
+
get(format) {
|
|
51
|
+
const handler = this.handlers.get(format);
|
|
52
|
+
if (handler) {
|
|
53
|
+
this.handlers.delete(format);
|
|
54
|
+
handler();
|
|
55
|
+
}
|
|
56
|
+
return this.contents.get(format);
|
|
57
|
+
}
|
|
58
|
+
set(format, value) {
|
|
59
|
+
if (!this.storing) {
|
|
60
|
+
this.handlers.delete(format);
|
|
61
|
+
}
|
|
62
|
+
this.contents.set(format, value);
|
|
63
|
+
this.version++;
|
|
64
|
+
}
|
|
65
|
+
/** `handler` to give `format`'s data when it is first read, in place of what it holds. */
|
|
66
|
+
setHandler(format, handler) {
|
|
67
|
+
this.contents.delete(format);
|
|
68
|
+
this.handlers.set(format, handler);
|
|
69
|
+
this.version++;
|
|
70
|
+
}
|
|
71
|
+
delete(format) {
|
|
72
|
+
this.contents.delete(format);
|
|
73
|
+
this.handlers.delete(format);
|
|
74
|
+
this.version++;
|
|
75
|
+
}
|
|
76
|
+
clear() {
|
|
77
|
+
this.contents.clear();
|
|
78
|
+
this.handlers.clear();
|
|
79
|
+
this.version++;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* `f` as the handling of a user's event, in which scripts may write;
|
|
83
|
+
* once the outermost ends, what they wrote goes to the host, unless a
|
|
84
|
+
* copy event takes it.
|
|
85
|
+
*/
|
|
86
|
+
gesture(f) {
|
|
87
|
+
const start = this.version;
|
|
88
|
+
this.gestures++;
|
|
89
|
+
try {
|
|
90
|
+
return f();
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
this.gestures--;
|
|
94
|
+
if (this.gestures === 0 && this.collecting === 0 && this.version !== start) {
|
|
95
|
+
// A host that throws must not take the key or press's handling with it.
|
|
96
|
+
try {
|
|
97
|
+
this.host?.write(this.data);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// The system's clipboard keeps what it had.
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** `f` as a copy or cut: what it wrote, for the host's event to carry, or null where it wrote nothing. */
|
|
106
|
+
collect(f) {
|
|
107
|
+
const start = this.version;
|
|
108
|
+
this.collecting++;
|
|
109
|
+
try {
|
|
110
|
+
this.gesture(f);
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
this.collecting--;
|
|
114
|
+
}
|
|
115
|
+
return this.version !== start ? this.data : null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* `f` as a paste of `data` from the system, in which scripts may read
|
|
119
|
+
* it. The clipboard's own formats stay where the system's text is what
|
|
120
|
+
* the SWF last put there, as a copy within the SWF comes back.
|
|
121
|
+
*/
|
|
122
|
+
paste(data, f) {
|
|
123
|
+
if (data) {
|
|
124
|
+
this.receive(data);
|
|
125
|
+
}
|
|
126
|
+
this.pastes++;
|
|
127
|
+
try {
|
|
128
|
+
return this.gesture(f);
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
this.pastes--;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
receive({ text, html }) {
|
|
135
|
+
const held = this.data;
|
|
136
|
+
if (held.text === text && (html === undefined || held.html === html)) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this.contents.clear();
|
|
140
|
+
this.handlers.clear();
|
|
141
|
+
this.contents.set(TEXT, text);
|
|
142
|
+
if (html !== undefined) {
|
|
143
|
+
this.contents.set(HTML, html);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|