UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

129 lines (93 loc) 3.49 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ Class(&#39;Scope.Provider&#39;, { /*VERSION,*/ has : { name : null, launchId : null, scope : null, seedingCode : null, seedingScript : null, seedingScriptIsEcmaModule : false, preload : { is : &#39;ro&#39;, init : Joose.I.Array }, cleanupCallback : null, beforeCleanupCallback : null }, methods : { isCSS : function (url) { return /\.css(\?.*)?$/i.test(url) }, isAlreadySetUp : function () { return Boolean(this.scope) }, addPreload : function (preloadDesc) { if (this.isAlreadySetUp()) throw new Error(&quot;Can&#39;t use `addPreload` - scope is already setup. Use `runCode/runScript` instead&quot;) if (typeof preloadDesc == &#39;string&#39;) if (this.isCSS(preloadDesc)) preloadDesc = { type : &#39;css&#39;, url : preloadDesc } else preloadDesc = { type : &#39;js&#39;, url : preloadDesc } else if (preloadDesc.text) preloadDesc = { type : &#39;js&#39;, content : preloadDesc.text } if (!preloadDesc.type) throw new Error(&quot;Preload descriptor must have the `type` property&quot;) this.preload.push(preloadDesc) }, addOnErrorHandler : function (handler, callback) { throw &quot;Abstract method `addOnErrorHandler` of Scope.Provider called&quot; }, create : function () { throw &quot;Abstract method `create` of Scope.Provider called&quot; }, setup : function (callback) { throw &quot;Abstract method `setup` of Scope.Provider called&quot; }, cleanup : function (callback) { throw &quot;Abstract method `cleanup` of Scope.Provider called&quot; }, runCode : function (text, callback) { throw &quot;Abstract method `runCode` of Scope.Provider called&quot; }, runScript : function (url, callback) { throw &quot;Abstract method `runScript` of Scope.Provider called&quot; } } }) Scope.Provider.__ONLOAD__ = {} Scope.Provider.__ONERROR__ = {} Scope.Provider.__FAILED_PRELOAD__ = {}</pre> </body> </html>