@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,249 @@
|
|
|
1
|
+
// AVM1's own functions, those DefineFunction and DefineFunction2 make, and
|
|
2
|
+
// what calling them takes, as Ruffle's (https://github.com/ruffle-rs/ruffle)
|
|
3
|
+
// core/src/avm1/function.rs and object/super_object.rs have them: MIT OR
|
|
4
|
+
// Apache-2.0, Copyright (c) 2018-2022 Ruffle LLC and Ruffle contributors.
|
|
5
|
+
// Where adl parts from Ruffle, adl decides (docs/avm1.md, "Functions and
|
|
6
|
+
// registers").
|
|
7
|
+
//
|
|
8
|
+
// A function's code is a region of its block's compiled entry, which
|
|
9
|
+
// takes the activation, `this` and the arguments; a DefineFunction2's
|
|
10
|
+
// registers are the region's own `let`s, which it loads itself. What
|
|
11
|
+
// the call needs of the runtime is here: an activation object for its
|
|
12
|
+
// local variables, its parameters without a register among them, and
|
|
13
|
+
// `arguments` and `super`, made only if the code asks for them.
|
|
14
|
+
import { Activation, PENDING_Arguments, PENDING_Super } from "./activation.js";
|
|
15
|
+
import { targetOrRoot } from "./clips.js";
|
|
16
|
+
import { BASE_REMOVED, Disabled } from "./errors.js";
|
|
17
|
+
import { Avm1Function, Avm1Object, DONT_ENUM, fold } from "./objects.js";
|
|
18
|
+
import { SCOPE_Local, SCOPE_Target, Scope } from "./scope.js";
|
|
19
|
+
import { isPrimitive } from "./values.js";
|
|
20
|
+
// DefineFunction2's flags (the SWF's FunctionFlags).
|
|
21
|
+
const FUNCTION_PreloadThis = 0x001;
|
|
22
|
+
const FUNCTION_SuppressThis = 0x002;
|
|
23
|
+
const FUNCTION_PreloadArguments = 0x004;
|
|
24
|
+
const FUNCTION_SuppressArguments = 0x008;
|
|
25
|
+
const FUNCTION_PreloadSuper = 0x010;
|
|
26
|
+
const FUNCTION_SuppressSuper = 0x020;
|
|
27
|
+
/** A DefineFunction or DefineFunction2's function. */
|
|
28
|
+
export class ScriptFunction extends Avm1Function {
|
|
29
|
+
world;
|
|
30
|
+
region;
|
|
31
|
+
code;
|
|
32
|
+
params;
|
|
33
|
+
flags;
|
|
34
|
+
version;
|
|
35
|
+
scope;
|
|
36
|
+
pool;
|
|
37
|
+
target;
|
|
38
|
+
clip;
|
|
39
|
+
definer;
|
|
40
|
+
constructor(proto, world,
|
|
41
|
+
/** The region of its body. */
|
|
42
|
+
region,
|
|
43
|
+
/** Its block's regions, which DefineFunction in its body makes functions of. */
|
|
44
|
+
code,
|
|
45
|
+
/** Its parameters' names, null for those in a register. */
|
|
46
|
+
params,
|
|
47
|
+
/** DefineFunction2's flags, 0 for a DefineFunction. */
|
|
48
|
+
flags,
|
|
49
|
+
/** The version of the SWF that defined it. */
|
|
50
|
+
version,
|
|
51
|
+
/** The scope chain it was defined in, which it closes over from SWF 6. */
|
|
52
|
+
scope,
|
|
53
|
+
/** The constant pool of the activation that defined it, as it was then. */
|
|
54
|
+
pool,
|
|
55
|
+
/** The clip whose code defined it, its activation's base clip, its target from SWF 6. */
|
|
56
|
+
target, clip,
|
|
57
|
+
/**
|
|
58
|
+
* The `this` of the activation that defined it, which is its own where
|
|
59
|
+
* DefineFunction2 preloads or suppresses `this`; undefined from SWF 5,
|
|
60
|
+
* whose functions close over nothing (adl; Ruffle takes the caller's).
|
|
61
|
+
*/
|
|
62
|
+
definer) {
|
|
63
|
+
super(proto, world, notNative);
|
|
64
|
+
this.world = world;
|
|
65
|
+
this.region = region;
|
|
66
|
+
this.code = code;
|
|
67
|
+
this.params = params;
|
|
68
|
+
this.flags = flags;
|
|
69
|
+
this.version = version;
|
|
70
|
+
this.scope = scope;
|
|
71
|
+
this.pool = pool;
|
|
72
|
+
this.target = target;
|
|
73
|
+
this.clip = clip;
|
|
74
|
+
this.definer = definer;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Run its body with `self` as `this`, `depth` how far up `this`'s
|
|
78
|
+
* prototypes it was found (which `super` starts from), in an activation
|
|
79
|
+
* of its own above the scope it closes over, or from SWF 5 above the
|
|
80
|
+
* clip of `this` or of the caller's target, as Flash 5 ran functions.
|
|
81
|
+
*/
|
|
82
|
+
call(self, args, version, depth = 0) {
|
|
83
|
+
const realm = this.world;
|
|
84
|
+
const caller = realm.current;
|
|
85
|
+
if (caller === null) {
|
|
86
|
+
throw new Error("an AVM1 function called outside of AVM1 code");
|
|
87
|
+
}
|
|
88
|
+
if (realm.calls + 1 >= realm.maxCalls) {
|
|
89
|
+
throw new Disabled(`${realm.maxCalls} levels of recursion were exceeded`);
|
|
90
|
+
}
|
|
91
|
+
// Calls count down to the script timeout's check, as jumps back do.
|
|
92
|
+
if (--realm.budget < 0) {
|
|
93
|
+
realm.timeout();
|
|
94
|
+
}
|
|
95
|
+
if (self !== undefined && self !== null && isPrimitive(self)) {
|
|
96
|
+
self = realm.box(self, version);
|
|
97
|
+
}
|
|
98
|
+
let scope = this.scope;
|
|
99
|
+
let target = this.target;
|
|
100
|
+
let clip = this.clip;
|
|
101
|
+
if (this.version < 6) {
|
|
102
|
+
const own = self instanceof Avm1Object ? caller.host.clipOf?.(self) : undefined;
|
|
103
|
+
if (own !== undefined) {
|
|
104
|
+
target = own;
|
|
105
|
+
clip = self;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
target = targetOrRoot(caller);
|
|
109
|
+
clip = caller.clip;
|
|
110
|
+
}
|
|
111
|
+
scope = new Scope(realm.globalScope, SCOPE_Target, clip);
|
|
112
|
+
}
|
|
113
|
+
const flags = this.flags;
|
|
114
|
+
const local = new Avm1Object();
|
|
115
|
+
const inherited = (flags & (FUNCTION_PreloadThis | FUNCTION_SuppressThis)) !== 0;
|
|
116
|
+
const cx = new Activation(caller.st, this.pool, target, caller.host, realm,
|
|
117
|
+
// adl counts a SWF 5 function's chain as a timeline's, for the With's limit.
|
|
118
|
+
new Scope(scope, SCOPE_Local, local, this.version < 6 ? scope.depth : scope.depth + 1), inherited ? this.definer : self, clip);
|
|
119
|
+
cx.code = this.code;
|
|
120
|
+
cx.callee = this;
|
|
121
|
+
cx.caller = caller.callee;
|
|
122
|
+
cx.args = args;
|
|
123
|
+
cx.depth = depth;
|
|
124
|
+
cx.receiver = self;
|
|
125
|
+
const params = this.params;
|
|
126
|
+
for (let i = 0; i < params.length; i++) {
|
|
127
|
+
const name = params[i];
|
|
128
|
+
if (name !== null) {
|
|
129
|
+
defineParam(local, name, i < args.length ? args[i] : undefined, this.version);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
let pending = 0;
|
|
133
|
+
if ((flags & (FUNCTION_PreloadArguments | FUNCTION_SuppressArguments)) === 0) {
|
|
134
|
+
pending |= PENDING_Arguments;
|
|
135
|
+
}
|
|
136
|
+
if ((flags & (FUNCTION_PreloadSuper | FUNCTION_SuppressSuper)) === 0 &&
|
|
137
|
+
depth > 0 &&
|
|
138
|
+
this.version >= 6 &&
|
|
139
|
+
self instanceof Avm1Object) {
|
|
140
|
+
pending |= PENDING_Super;
|
|
141
|
+
}
|
|
142
|
+
if (pending !== 0) {
|
|
143
|
+
cx.pending = pending;
|
|
144
|
+
local.lazy = cx;
|
|
145
|
+
}
|
|
146
|
+
realm.calls++;
|
|
147
|
+
realm.current = cx;
|
|
148
|
+
try {
|
|
149
|
+
return this.region(cx, self, args);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
// Its clip was removed under it: it returns undefined there.
|
|
153
|
+
if (error === BASE_REMOVED) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
realm.calls--;
|
|
160
|
+
realm.current = caller;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/** As a constructor: its result is the object `new` made, whatever the body returns. */
|
|
164
|
+
initialize(self, args, version) {
|
|
165
|
+
this.call(self, args, version, 1);
|
|
166
|
+
}
|
|
167
|
+
callConstructor(self, args, version, depth) {
|
|
168
|
+
return this.call(self, args, version, depth);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function notNative() {
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
/** A parameter as a local variable; of two of the same name, the later. */
|
|
175
|
+
function defineParam(local, name, value, version) {
|
|
176
|
+
const p = local.own(name, version);
|
|
177
|
+
if (p === undefined) {
|
|
178
|
+
local.add(name, value, 0);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
p.value = value;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* `super` in a method: an object whose prototype is the one above where
|
|
186
|
+
* the method was found, whose methods run with the method's `this`.
|
|
187
|
+
*/
|
|
188
|
+
export class Avm1Super extends Avm1Object {
|
|
189
|
+
self;
|
|
190
|
+
depth;
|
|
191
|
+
constructor(
|
|
192
|
+
/** The `this` of the method that made it. */
|
|
193
|
+
self,
|
|
194
|
+
/** How far up `self`'s prototypes the method was found. */
|
|
195
|
+
depth, version) {
|
|
196
|
+
super(superProto(self, depth, version));
|
|
197
|
+
this.self = self;
|
|
198
|
+
this.depth = depth;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** The prototype `depth` steps up from `self`, then its own: where `super` looks. */
|
|
202
|
+
function superProto(self, depth, version) {
|
|
203
|
+
let base = self;
|
|
204
|
+
for (let i = 0; i < depth; i++) {
|
|
205
|
+
if (!(base instanceof Avm1Object)) {
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
base = base.protoFor(version);
|
|
209
|
+
}
|
|
210
|
+
return base instanceof Avm1Object ? base.protoFor(version) : undefined;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* `super` for an activation, undefined where it has none: a plain call has
|
|
214
|
+
* none, nor does a SWF 5 (adl).
|
|
215
|
+
*/
|
|
216
|
+
export function superOf(cx, self, version) {
|
|
217
|
+
return cx.depth > 0 && version >= 6 && self instanceof Avm1Object
|
|
218
|
+
? new Avm1Super(self, cx.depth, version)
|
|
219
|
+
: undefined;
|
|
220
|
+
}
|
|
221
|
+
/** A function's `arguments`: an array of them, with `callee` and `caller`. */
|
|
222
|
+
export function argumentsOf(cx, args, version) {
|
|
223
|
+
const array = cx.realm.newArray(args, version);
|
|
224
|
+
array.define("callee", cx.callee, DONT_ENUM);
|
|
225
|
+
array.define("caller", cx.caller, DONT_ENUM);
|
|
226
|
+
return array;
|
|
227
|
+
}
|
|
228
|
+
/** Whether `name` is `local` for a SWF of `version`. */
|
|
229
|
+
const named = (name, local, version) => name === local || (version < 7 && fold(name) === local);
|
|
230
|
+
/**
|
|
231
|
+
* `arguments` or `super` on a function's activation object `o`, as a
|
|
232
|
+
* lookup first misses it; any other name stays missing.
|
|
233
|
+
*/
|
|
234
|
+
export function pendingLocal(cx, o, name, version) {
|
|
235
|
+
let p;
|
|
236
|
+
if (cx.pending & PENDING_Arguments && named(name, "arguments", version)) {
|
|
237
|
+
cx.pending &= ~PENDING_Arguments;
|
|
238
|
+
p = o.add("arguments", argumentsOf(cx, cx.args, version), 0);
|
|
239
|
+
}
|
|
240
|
+
else if (cx.pending & PENDING_Super && named(name, "super", version)) {
|
|
241
|
+
cx.pending &= ~PENDING_Super;
|
|
242
|
+
// Not listed by for..in, as `arguments` is (adl).
|
|
243
|
+
p = o.add("super", superOf(cx, cx.receiver, version), DONT_ENUM);
|
|
244
|
+
}
|
|
245
|
+
if (cx.pending === 0) {
|
|
246
|
+
o.lazy = null;
|
|
247
|
+
}
|
|
248
|
+
return p;
|
|
249
|
+
}
|