From a0d54af01585f7a9008093664dca3723070fb829 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 22:15:01 +0000 Subject: [PATCH 01/22] Initial plan for issue From 829228052a548c83f6492f56a4b7f1f3d1df49a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 22:40:42 +0000 Subject: [PATCH 02/22] Fix Angular SSR in Cloudflare Worker issue Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 26 ++++++++++++++++++++++++++ lib/tsconfig.json | 1 - 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index dcb6cb9..8a82a19 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -18,6 +18,23 @@ interface DynamicGlobalSettings { const UNDEFINED = "undefined"; +/** + * Helper to check if we're running in a server-side rendering environment + * like Node.js or Cloudflare Workers + * @ignore + */ +function _isServerSideRender(): boolean { + const gbl = getGlobal(); + // Check for common server-side environments + // 1. Missing window or document (Node.js, some SSR frameworks) + // 2. Cloudflare Worker specific environment + return (typeof gbl.window === UNDEFINED || + typeof gbl.document === UNDEFINED || + (typeof gbl.navigator !== UNDEFINED && + typeof gbl.navigator.userAgent !== UNDEFINED && + gbl.navigator.userAgent.indexOf('Cloudflare-Workers') >= 0)); +} + /** * Constant string defined to support minimization * @ignore @@ -580,6 +597,15 @@ export type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPT * @param options - Additional options to configure how the dynamic prototype operates */ export default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void { + // Check if we're in a server-side rendering environment like Cloudflare Workers + // where some operations like manipulating function name properties may be restricted + if (_isServerSideRender()) { + // In SSR, we still want to run the delegate function to set up instance methods, + // but we'll skip the prototype modifications that cause issues in environments like Cloudflare Workers + delegateFunc(target, target as DPType); + return; + } + // Make sure that the passed theClass argument looks correct if (!objHasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); diff --git a/lib/tsconfig.json b/lib/tsconfig.json index 77db2e3..bf035bb 100644 --- a/lib/tsconfig.json +++ b/lib/tsconfig.json @@ -14,7 +14,6 @@ "declarationDir": "./types", "outDir": "./dist-es5", "rootDir": "./src", - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "removeComments": false }, From 39a708cfff933ce13098c66c4a72348fa77fe142 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 22:46:10 +0000 Subject: [PATCH 03/22] Update documentation and version for SSR compatibility Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- README.md | 36 +++++++++++++++++++++--------------- RELEASES.md | 9 +++++++++ package.json | 2 +- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9c326f3..1f9ea5d 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,27 @@ Generates dynamic prototype methods for JavaScript objects (classes) by supporting method definition within their "class" constructor (like an instance version), this removes the need to expose internal properties on the instance (this) and the usage of ```ClassName.prototype.funcName()``` both of which result in better code minfication (smaller output) and therefore improved load times for your users. -The dynamically generated prototype methods support class inheritance of any type, which means you can extend from base classes that use instance or prototype defined methods, you also don't need to add the normal boiler plate code to handle detecting, saving and calling any previous instance methods that you are overriding as support for this is provided automatically. - -So whether creating a new class or extending some other class/code, your resulting code, can be successfully extended via TypeScript or JavaScript. - -> ES3 / IE8 support has been removed from Version 2.x. -> -> if you need to retain ES3 / IE8 support then you will need to use one of the 1.x versions which is now maintained on the old [master branch](https://github.com/microsoft/DynamicProto-JS/tree/master) - -The version 2.x is maintained on the default [main branch](https://github.com/microsoft/DynamicProto-JS/tree/main) - -## Documentation - -[Github Documentation](https://microsoft.github.io/DynamicProto-JS/) includes [typedoc API references](https://microsoft.github.io/DynamicProto-JS/typedoc/index.html). - -## Removing / Hiding internal properties from instance +The dynamically generated prototype methods support class inheritance of any type, which means you can extend from base classes that use instance or prototype defined methods, you also don't need to add the normal boiler plate code to handle detecting, saving and calling any previous instance methods that you are overriding as support for this is provided automatically. + +So whether creating a new class or extending some other class/code, your resulting code, can be successfully extended via TypeScript or JavaScript. + +> ES3 / IE8 support has been removed from Version 2.x. +> +> if you need to retain ES3 / IE8 support then you will need to use one of the 1.x versions which is now maintained on the old [master branch](https://github.com/microsoft/DynamicProto-JS/tree/master) + +The version 2.x is maintained on the default [main branch](https://github.com/microsoft/DynamicProto-JS/tree/main) + +## Server-Side Rendering Support + +As of version 2.0.4, DynamicProto-JS includes support for Server-Side Rendering (SSR) environments, including Cloudflare Workers. In SSR contexts, the library automatically detects the environment and provides simplified functionality that avoids operations that might cause issues in restricted environments. + +This ensures compatibility with Angular SSR and other server-side frameworks without requiring additional configuration. + +## Documentation + +[Github Documentation](https://microsoft.github.io/DynamicProto-JS/) includes [typedoc API references](https://microsoft.github.io/DynamicProto-JS/typedoc/index.html). + +## Removing / Hiding internal properties from instance By defining the properties / methods within the constructors closure, each instance can contain or define internal state in the form of properties which it does not have to expose publically as each defined "public" instance method has direct access to this define state within the context/scope of the closure method. While this does require some additional CPU and memory at the point of creating each instance object this is designed to be as minimal as possible and should be outwayed by the following advantages :- diff --git a/RELEASES.md b/RELEASES.md index f64fd82..57b04ae 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,14 @@ # Releases +## 2.0.4 (May 2024) + +### Changes + +- #95 [BUG] AppInsights breaks Angular SSR in Cloudflare Worker + - Added support for Server-Side Rendering environments, including Cloudflare Workers + - Modified the `dynamicProto` function to detect SSR environments and avoid operations that cause issues with property redefinition + - This ensures compatibility with Angular SSR and other server-side frameworks + ## 2.0.3 (Jan 11th, 2024) Blocks a medium level prototype pollution vulnerability. diff --git a/package.json b/package.json index 70bab56..e553380 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/dynamicproto-js", "description": "Microsoft Dynamic Proto Utility", - "version": "2.0.3", + "version": "2.0.4", "keywords": [ "javascript", "dynamic prototype", From 3859b4551e63fa23235da5d592a0e157b118fcfc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 23:10:31 +0000 Subject: [PATCH 04/22] Change version date from May 2024 to Unreleased in RELEASES.md Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 57b04ae..17194da 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,6 +1,6 @@ # Releases -## 2.0.4 (May 2024) +## 2.0.4 (Unreleased) ### Changes From 1fe54b0919db749c0331233c9ebce74b74702fd3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 23:20:00 +0000 Subject: [PATCH 05/22] Optimize SSR support by using setInstanceFunc flag instead of early return Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 13 +- lib/test/Selenium/dynamicprototests.d.ts | 301 ++ lib/test/Selenium/dynamicprototests.js | 3775 +++++++++++++++++ lib/test/Selenium/dynamicprototests.js.map | 1 + .../Selenium/dynamicprotorolluptests.d.ts | 214 + .../test/Selenium/dynamicprotorolluptests.js | 1107 +++++ .../Selenium/dynamicprotorolluptests.js.map | 1 + 7 files changed, 5401 insertions(+), 11 deletions(-) create mode 100644 lib/test/Selenium/dynamicprototests.d.ts create mode 100644 lib/test/Selenium/dynamicprototests.js create mode 100644 lib/test/Selenium/dynamicprototests.js.map create mode 100644 rollup/test/Selenium/dynamicprotorolluptests.d.ts create mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js create mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js.map diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index 8a82a19..f806590 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -597,15 +597,6 @@ export type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPT * @param options - Additional options to configure how the dynamic prototype operates */ export default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void { - // Check if we're in a server-side rendering environment like Cloudflare Workers - // where some operations like manipulating function name properties may be restricted - if (_isServerSideRender()) { - // In SSR, we still want to run the delegate function to set up instance methods, - // but we'll skip the prototype modifications that cause issues in environments like Cloudflare Workers - delegateFunc(target, target as DPType); - return; - } - // Make sure that the passed theClass argument looks correct if (!objHasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); @@ -646,8 +637,8 @@ export default function dynamicProto(theClass:DPCls, target:DPTyp // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs as DPType); - // Don't allow setting instance functions for older IE instances - let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; + // Don't allow setting instance functions for older IE instances or in SSR environments + let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isServerSideRender(); if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } diff --git a/lib/test/Selenium/dynamicprototests.d.ts b/lib/test/Selenium/dynamicprototests.d.ts new file mode 100644 index 0000000..5b2eebd --- /dev/null +++ b/lib/test/Selenium/dynamicprototests.d.ts @@ -0,0 +1,301 @@ +/// +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +declare class Assert { + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static deepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static equal(expected: any, actual: any, message?: string): any; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static notDeepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notEqual(expected: any, actual: any, message?: string): any; + static notPropEqual(expected: any, actual: any, message?: string): any; + static propEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notStrictEqual(expected: any, actual: any, message?: string): any; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + static ok(state: any, message?: string): any; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static strictEqual(expected: any, actual: any, message?: string): any; + /** + * Assertion to test if a callback throws an exception when run. + * + * When testing code that is expected to throw an exception based on a specific set of + * circumstances, use throws() to catch the error object for testing and comparison. + * + * @param block Function to execute + * @param expected Error Object to compare + * @param message A short description of the assertion + */ + static throws(block: () => any, expected: any, message?: string): any; + /** + * @param block Function to execute + * @param message A short description of the assertion + */ + static throws(block: () => any, message?: string): any; +} +/** Defines a test case */ +declare class TestCase { + /** Name to use for the test case */ + name: string; + /** Test case method */ + test: () => void; +} +/** Defines a test case */ +interface TestCaseAsync { + /** Name to use for the test case */ + name: string; + /** time to wait after pre before invoking post and calling start() */ + stepDelay: number; + /** async steps */ + steps: Array<() => void>; +} +declare class TestClass { + constructor(name?: string); + static isPollingStepFlag: string; + /** The instance of the currently running suite. */ + static currentTestClass: TestClass; + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + useFakeTimers: boolean; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + useFakeServer: boolean; + /** Method called before the start of each test method */ + testInitialize(): void; + /** Method called after each test method has completed */ + testCleanup(): void; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + registerTests(): void; + /** Register an async Javascript unit testcase. */ + testCaseAsync(testInfo: TestCaseAsync): void; + /** Register a Javascript unit testcase. */ + testCase(testInfo: TestCase): void; + /** Called when the test is starting. */ + private _testStarting; + /** Called when the test is completed. */ + private _testCompleted; + /**** Sinon methods and properties ***/ + clock: SinonFakeTimers; + server: SinonFakeServer; + sandbox: SinonSandbox; + /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ + spy(): SinonSpy; + /** Spies on the provided function */ + spy(funcToWrap: Function): SinonSpy; + /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ + spy(object: any, methodName: string, func?: Function): SinonSpy; + /** Creates an anonymous stub function. */ + stub(): SinonStub; + /** Stubs all the object's methods. */ + stub(object: any): SinonStub; + /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ + stub(object: any, methodName: string, func?: Function): SinonStub; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + mock(object: any): SinonMock; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; + protected setUserAgent(userAgent: string): void; +} +declare module "src/DynamicProto" { + /** + * Interface to define additional configuration options to control how the dynamic prototype functions operate. + */ + export interface IDynamicProtoOpts { + /** + * Should the dynamic prototype attempt to set an instance function for instances that do not already have an + * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function. + */ + setInstFuncs: boolean; + /** + * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions + * and bypass the prototype lookups. Defaults to true. + */ + useBaseInst?: boolean; + } + /** + * The delegate signature for the function used as the callback for dynamicProto() + * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even + * though it is only a proxy that only contains the functions + * @param theTarget This is the real "this" of the current target object + * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the "this" instance before + * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the "super" keyword. + */ + export type DynamicProtoDelegate = (theTarget: DPType, baseFuncProxy?: DPType) => void; + /** + * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- + * - Saves references to all defined base class functions + * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. + * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. + * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is + * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of + * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" + * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions + * defined in the constructor or some other function (rather than declared as complete typescript functions). + * ### Usage + * ```typescript + * import dynamicProto from "@microsoft/dynamicproto-js"; + * class ExampleClass extends BaseClass { + * constructor() { + * dynamicProto(ExampleClass, this, (_self, base) => { + * // This will define a function that will be converted to a prototype function + * _self.newFunc = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * ... + * } + * } + * // This will define a function that will be converted to a prototype function + * _self.myFunction = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * // Call the base version of the function that we are overriding + * base.myFunction(); + * } + * ... + * } + * _self.initialize = () => { + * ... + * } + * // Warnings: While the following will work as _self is simply a reference to + * // this, if anyone overrides myFunction() the overridden will be called first + * // as the normal JavaScript method resolution will occur and the defined + * // _self.initialize() function is actually gets removed from the instance and + * // a proxy prototype version is created to reference the created method. + * _self.initialize(); + * }); + * } + * } + * ``` + * @typeparam DPType This is the generic type of the class, used to keep intellisense valid + * @typeparam DPCls The type that contains the prototype of the current class + * @param theClass - This is the current class instance which contains the prototype for the current class + * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. + * @param delegateFunc - The callback function (closure) that will create the dynamic function + * @param options - Additional options to configure how the dynamic prototype operates + */ + export default function dynamicProto(theClass: DPCls, target: DPType, delegateFunc: DynamicProtoDelegate, options?: IDynamicProtoOpts): void; +} +declare module "test/DynamicProto.Tests" { + export class DynamicProtoDefaultTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/DynamicProtoMultipleCall.Tests" { + export class DynamicProtoMultipleCallTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/DynamicProtoNoInst.Tests" { + export class DynamicProtoNoInstTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/DynamicProtoMultipleNoInst.Tests" { + export class DynamicProtoMultipleNoInstTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/SecurityCheck.Tests" { + export class SecurityCheckTests extends TestClass { + testInitialize(): void; + registerTests(): void; + } +} +declare module "test/Selenium/DynamicProtoTests" { + export function runTests(): void; +} diff --git a/lib/test/Selenium/dynamicprototests.js b/lib/test/Selenium/dynamicprototests.js new file mode 100644 index 0000000..4ad2564 --- /dev/null +++ b/lib/test/Selenium/dynamicprototests.js @@ -0,0 +1,3775 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +var Assert = /** @class */ (function () { + function Assert() { + } + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.deepEqual = function (expected, actual, message) { + return deepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.equal = function (expected, actual, message) { + return equal(actual, expected, message); + }; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.notDeepEqual = function (expected, actual, message) { + return notDeepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notEqual = function (expected, actual, message) { + return notEqual(actual, expected, message); + }; + Assert.notPropEqual = function (expected, actual, message) { + return notPropEqual(actual, expected, message); + }; + Assert.propEqual = function (expected, actual, message) { + return propEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notStrictEqual = function (expected, actual, message) { + return notStrictEqual(actual, expected, message); + }; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + Assert.ok = function (state, message) { + return ok(state, message); + }; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.strictEqual = function (expected, actual, message) { + return strictEqual(actual, expected, message); + }; + Assert.throws = function (block, expected, message) { + return throws(block, expected, message); + }; + return Assert; +}()); +/** Defines a test case */ +var TestCase = /** @class */ (function () { + function TestCase() { + } + return TestCase; +}()); +/// +/// +/// +/// +var TestClass = /** @class */ (function () { + function TestClass(name) { + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + this.useFakeTimers = true; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + this.useFakeServer = true; + QUnit.module(name); + } + /** Method called before the start of each test method */ + TestClass.prototype.testInitialize = function () { + }; + /** Method called after each test method has completed */ + TestClass.prototype.testCleanup = function () { + }; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + TestClass.prototype.registerTests = function () { + }; + /** Register an async Javascript unit testcase. */ + TestClass.prototype.testCaseAsync = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (isNaN(testInfo.stepDelay)) { + throw new Error("Must specify 'stepDelay' period between pre and post"); + } + if (!testInfo.steps) { + throw new Error("Must specify 'steps' to take asynchronously"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function (assert) { + var done = assert.async(); + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + var steps_1 = testInfo.steps; + var trigger_1 = function () { + if (steps_1.length) { + var step = steps_1.shift(); + // The callback which activates the next test step. + var nextTestStepTrigger = function () { + setTimeout(function () { + trigger_1(); + }, testInfo.stepDelay); + }; + // There 2 types of test steps - simple and polling. + // Upon completion of the simple test step the next test step will be called. + // In case of polling test step the next test step is passed to the polling test step, and + // it is responsibility of the polling test step to call the next test step. + try { + if (step[TestClass.isPollingStepFlag]) { + step.call(_this, nextTestStepTrigger); + } + else { + step.call(_this); + nextTestStepTrigger.call(_this); + } + } + catch (e) { + _this._testCompleted(); + Assert.ok(false, e.toString()); + // done is QUnit callback indicating the end of the test + done(); + return; + } + } + else { + _this._testCompleted(); + // done is QUnit callback indicating the end of the test + done(); + } + }; + trigger_1(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + // done is QUnit callback indicating the end of the test + done(); + } + }; + // Register the test with QUnit + QUnit.test(testInfo.name, testMethod); + }; + /** Register a Javascript unit testcase. */ + TestClass.prototype.testCase = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (!testInfo.test) { + throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function () { + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + testInfo.test.call(_this); + _this._testCompleted(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + } + }; + // Register the test with QUnit + test(testInfo.name, testMethod); + }; + /** Called when the test is starting. */ + TestClass.prototype._testStarting = function () { + // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. + var config = sinon.getConfig(sinon.config); + config.useFakeTimers = this.useFakeTimers; + config.useFakeServer = this.useFakeServer; + config.injectInto = config.injectIntoThis && this || config.injectInto; + this.sandbox = sinon.sandbox.create(config); + this.server = this.sandbox.server; + // Allow the derived class to perform test initialization. + this.testInitialize(); + }; + /** Called when the test is completed. */ + TestClass.prototype._testCompleted = function (failed) { + if (failed) { + // Just cleanup the sandbox since the test has already failed. + this.sandbox.restore(); + } + else { + // Verify the sandbox and restore. + this.sandbox.verifyAndRestore(); + } + this.testCleanup(); + // Clear the instance of the currently running suite. + TestClass.currentTestClass = null; + }; + TestClass.prototype.spy = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + TestClass.prototype.stub = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + TestClass.prototype.mock = function (object) { return null; }; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { + if (errorCode === undefined) { + errorCode = 200; + } + request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); + }; + TestClass.prototype.setUserAgent = function (userAgent) { + Object.defineProperty(window.navigator, 'userAgent', { + configurable: true, + get: function () { + return userAgent; + } + }); + }; + TestClass.isPollingStepFlag = "isPollingStep"; + return TestClass; +}()); +// Configure Sinon +sinon.assert.fail = function (msg) { + Assert.ok(false, msg); +}; +sinon.assert.pass = function (assertion) { + Assert.ok(assertion, "sinon assert"); +}; +sinon.config = { + injectIntoThis: true, + injectInto: null, + properties: ["spy", "stub", "mock", "clock", "sandbox"], + useFakeTimers: true, + useFakeServer: true +}; +/// +/// +/// +/// +/// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +define("src/DynamicProto", ["require", "exports", "@nevware21/ts-utils"], function (require, exports, ts_utils_1) { + "use strict"; + var _a; + Object.defineProperty(exports, "__esModule", { value: true }); + ; + var UNDEFINED = "undefined"; + /** + * Helper to check if we're running in a server-side rendering environment + * like Node.js or Cloudflare Workers + * @ignore + */ + function _isServerSideRender() { + var gbl = (0, ts_utils_1.getGlobal)(); + // Check for common server-side environments + // 1. Missing window or document (Node.js, some SSR frameworks) + // 2. Cloudflare Worker specific environment + return (typeof gbl.window === UNDEFINED || + typeof gbl.document === UNDEFINED || + (typeof gbl.navigator !== UNDEFINED && + typeof gbl.navigator.userAgent !== UNDEFINED && + gbl.navigator.userAgent.indexOf('Cloudflare-Workers') >= 0)); + } + /** + * Constant string defined to support minimization + * @ignore + */ + var Constructor = 'constructor'; + /** + * Constant string defined to support minimization + * @ignore + */ + var Prototype = 'prototype'; + /** + * Constant string defined to support minimization + * @ignore + */ + var strFunction = 'function'; + /** + * Used to define the name of the instance function lookup table + * @ignore + */ + var DynInstFuncTable = '_dynInstFuncs'; + /** + * Name used to tag the dynamic prototype function + * @ignore + */ + var DynProxyTag = '_isDynProxy'; + /** + * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table + * @ignore + */ + var DynClassName = '_dynClass'; + /** + * Prefix added to the classname to avoid any name clashes with other instance level properties + * @ignore + */ + var DynClassNamePrefix = '_dynCls$'; + /** + * A tag which is used to check if we have already to attempted to set the instance function if one is not present + * @ignore + */ + var DynInstChkTag = '_dynInstChk'; + /** + * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same + * tag name as the function level but a different const name for readability only. + */ + var DynAllowInstChkTag = DynInstChkTag; + /** + * The global (imported) instances where the global performance options are stored + */ + var DynProtoDefaultOptions = '_dfOpts'; + /** + * Value used as the name of a class when it cannot be determined + * @ignore + */ + var UnknownValue = '_unknown_'; + /** + * Constant string defined to support minimization + * @ignore + */ + var str__Proto = "__proto__"; + /** + * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist + */ + var DynProtoBaseProto = "_dyn" + str__Proto; + /** + * Runtime Global holder for dynamicProto settings + */ + var DynProtoGlobalSettings = "__dynProto$Gbl"; + /** + * Track the current prototype for IE8 as you can't look back to get the prototype + */ + var DynProtoCurrent = "_dynInstProto"; + /** + * Constant string defined to support minimization + * @ignore + */ + var strUseBaseInst = 'useBaseInst'; + /** + * Constant string defined to support minimization + * @ignore + */ + var strSetInstFuncs = 'setInstFuncs'; + var Obj = Object; + /** + * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) + * @ignore + */ + var _objGetPrototypeOf = Obj["getPrototypeOf"]; + /** + * Pre-lookup to check for the existence of this function + */ + var _objGetOwnProps = Obj["getOwnPropertyNames"]; + // Since 1.1.7 moving these to the runtime global to work around mixed version and module issues + // See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details + var _gbl = (0, ts_utils_1.getGlobal)(); + var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { + o: (_a = {}, + _a[strSetInstFuncs] = true, + _a[strUseBaseInst] = true, + _a), + n: 1000 // Start new global index @ 1000 so we "fix" some cases when mixed with 1.1.6 or earlier + }); + /** + * Helper used to check whether the target is an Object prototype or Array prototype + * @ignore + */ + function _isObjectOrArrayPrototype(target) { + return target && (target === Obj[Prototype] || target === Array[Prototype]); + } + /** + * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype + * @ignore + */ + function _isObjectArrayOrFunctionPrototype(target) { + return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; + } + /** + * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. + * @ignore + */ + function _getObjProto(target) { + var newProto; + if (target) { + // This method doesn't exist in older browsers (e.g. IE8) + if (_objGetPrototypeOf) { + return _objGetPrototypeOf(target); + } + var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); + // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class + newProto = target[DynProtoBaseProto] || curProto; + if (!(0, ts_utils_1.objHasOwnProperty)(target, DynProtoBaseProto)) { + // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it + // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) + delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy + newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; + target[DynProtoCurrent] = curProto; + } + } + return newProto; + } + /** + * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 + * are not enumerable. + * @param target + */ + function _forEachProp(target, func) { + var props = []; + if (_objGetOwnProps) { + props = _objGetOwnProps(target); + } + else { + for (var name_1 in target) { + if (typeof name_1 === "string" && (0, ts_utils_1.objHasOwnProperty)(target, name_1)) { + props.push(name_1); + } + } + } + if (props && props.length > 0) { + for (var lp = 0; lp < props.length; lp++) { + func(props[lp]); + } + } + } + /** + * Helper function to check whether the provided function name is a potential candidate for dynamic + * callback and prototype generation. + * @param target The target object, may be a prototype or class object + * @param funcName The function name + * @param skipOwn Skips the check for own property + * @ignore + */ + function _isDynamicCandidate(target, funcName, skipOwn) { + return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || (0, ts_utils_1.objHasOwnProperty)(target, funcName)) && funcName !== str__Proto && funcName !== Prototype); + } + /** + * Helper to throw a TypeError exception + * @param message the message + * @ignore + */ + function _throwTypeError(message) { + (0, ts_utils_1.throwTypeError)("DynamicProto: " + message); + } + /** + * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does + * not return any inherited functions + * @param thisTarget The object to get the instance functions from + * @ignore + */ + function _getInstanceFuncs(thisTarget) { + // Get the base proto + var instFuncs = (0, ts_utils_1.objCreate)(null); + // Save any existing instance functions + _forEachProp(thisTarget, function (name) { + // Don't include any dynamic prototype instances - as we only want the real functions + if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { + // Create an instance callback for passing the base function to the caller + instFuncs[name] = thisTarget[name]; + } + }); + return instFuncs; + } + /** + * Returns whether the value is included in the array + * @param values The array of values + * @param value The value + */ + function _hasVisited(values, value) { + for (var lp = values.length - 1; lp >= 0; lp--) { + if (values[lp] === value) { + return true; + } + } + return false; + } + /** + * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" + * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references + * @param target The current instance + * @ignore + */ + function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { + function _instFuncProxy(target, funcHost, funcName) { + var theFunc = funcHost[funcName]; + if (theFunc[DynProxyTag] && useBaseInst) { + // grab and reuse the hosted looking function (if available) otherwise the original passed function + var instFuncTable = target[DynInstFuncTable] || {}; + if (instFuncTable[DynAllowInstChkTag] !== false) { + theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; + } + } + return function () { + // eslint-disable-next-line prefer-rest-params + return theFunc.apply(target, arguments); + }; + } + // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) + var baseFuncs = (0, ts_utils_1.objCreate)(null); + _forEachProp(instFuncs, function (name) { + // Create an instance callback for passing the base function to the caller + baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); + }); + // Get the base prototype functions + var baseProto = _getObjProto(classProto); + var visited = []; + // Don't include base object functions for Object, Array or Function + while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { + // look for prototype functions + _forEachProp(baseProto, function (name) { + // Don't include any dynamic prototype instances - as we only want the real functions + // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the + // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return + // the Object prototype methods while bypassing the check + if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { + // Create an instance callback for passing the base function to the caller + baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); + } + }); + // We need to find all possible functions that might be overloaded by walking the entire prototype chain + // This avoids the caller from needing to check whether it's direct base class implements the function or not + // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. + visited.push(baseProto); + baseProto = _getObjProto(baseProto); + } + return baseFuncs; + } + function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { + var instFunc = null; + // We need to check whether the class name is defined directly on this prototype otherwise + // it will walk the proto chain and return any parent proto classname. + if (target && (0, ts_utils_1.objHasOwnProperty)(proto, DynClassName)) { + var instFuncTable = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); + instFunc = (instFuncTable[proto[DynClassName]] || (0, ts_utils_1.objCreate)(null))[funcName]; + if (!instFunc) { + // Avoid stack overflow from recursive calling the same function + _throwTypeError("Missing [" + funcName + "] " + strFunction); + } + // We have the instance function, lets check it we can speed up further calls + // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) + if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { + // If the instance already has an instance function we can't replace it + var canAddInst = !(0, ts_utils_1.objHasOwnProperty)(target, funcName); + // Get current prototype + var objProto = _getObjProto(target); + var visited = []; + // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function + // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut + while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { + var protoFunc = objProto[funcName]; + if (protoFunc) { + canAddInst = (protoFunc === currentDynProtoProxy); + break; + } + // We need to find all possible initial functions to ensure that we don't bypass a valid override function + visited.push(objProto); + objProto = _getObjProto(objProto); + } + try { + if (canAddInst) { + // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version + // so it's safe to directly assign for any subsequent calls (for better performance) + target[funcName] = instFunc; + } + // Block further attempts to set the instance function for any + instFunc[DynInstChkTag] = 1; + } + catch (e) { + // Don't crash if the object is readonly or the runtime doesn't allow changing this + // And set a flag so we don't try again for any function + instFuncTable[DynAllowInstChkTag] = false; + } + } + } + return instFunc; + } + function _getProtoFunc(funcName, proto, currentDynProtoProxy) { + var protoFunc = proto[funcName]; + // Check that the prototype function is not a self reference -- try to avoid stack overflow! + if (protoFunc === currentDynProtoProxy) { + // It is so lookup the base prototype + protoFunc = _getObjProto(proto)[funcName]; + } + if (typeof protoFunc !== strFunction) { + _throwTypeError("[" + funcName + "] is not a " + strFunction); + } + return protoFunc; + } + /** + * Add the required dynamic prototype methods to the the class prototype + * @param proto - The class prototype + * @param className - The instance classname + * @param target - The target instance + * @param baseInstFuncs - The base instance functions + * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist + * @ignore + */ + function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { + function _createDynamicPrototype(proto, funcName) { + var dynProtoProxy = function () { + // Use the instance or prototype function + var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); + // eslint-disable-next-line prefer-rest-params + return instFunc.apply(this, arguments); + }; + // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing + // via which can dynamically replace the prototype function reference) + dynProtoProxy[DynProxyTag] = 1; + return dynProtoProxy; + } + if (!_isObjectOrArrayPrototype(proto)) { + var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); + if (!_isObjectOrArrayPrototype(instFuncTable)) { + var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || (0, ts_utils_1.objCreate)(null)); // fetch and assign if as it may not exist yet + // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable + if (instFuncTable[DynAllowInstChkTag] !== false) { + instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; + } + if (!_isObjectOrArrayPrototype(instFuncs_1)) { + _forEachProp(target, function (name) { + // Only add overridden functions + if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { + // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function + instFuncs_1[name] = target[name]; + delete target[name]; + // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one + if (!(0, ts_utils_1.objHasOwnProperty)(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { + proto[name] = _createDynamicPrototype(proto, name); + } + } + }); + } + } + } + } + /** + * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance + * @param classProto The class prototype instance + * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy + * @ignore + */ + function _checkPrototype(classProto, thisTarget) { + // This method doesn't existing in older browsers (e.g. IE8) + if (_objGetPrototypeOf) { + // As this is primarily a coding time check, don't bother checking if running in IE8 or lower + var visited = []; + var thisProto = _getObjProto(thisTarget); + while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { + if (thisProto === classProto) { + return true; + } + // This avoids the caller from needing to check whether it's direct base class implements the function or not + // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. + visited.push(thisProto); + thisProto = _getObjProto(thisProto); + } + return false; + } + // If objGetPrototypeOf doesn't exist then just assume everything is ok. + return true; + } + /** + * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. + * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. + * @param target + * @param unknownValue + * @ignore + */ + function _getObjName(target, unknownValue) { + if ((0, ts_utils_1.objHasOwnProperty)(target, Prototype)) { + // Look like a prototype + return target.name || unknownValue || UnknownValue; + } + return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; + } + /** + * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- + * - Saves references to all defined base class functions + * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. + * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. + * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is + * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of + * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" + * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions + * defined in the constructor or some other function (rather than declared as complete typescript functions). + * ### Usage + * ```typescript + * import dynamicProto from "@microsoft/dynamicproto-js"; + * class ExampleClass extends BaseClass { + * constructor() { + * dynamicProto(ExampleClass, this, (_self, base) => { + * // This will define a function that will be converted to a prototype function + * _self.newFunc = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * ... + * } + * } + * // This will define a function that will be converted to a prototype function + * _self.myFunction = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * // Call the base version of the function that we are overriding + * base.myFunction(); + * } + * ... + * } + * _self.initialize = () => { + * ... + * } + * // Warnings: While the following will work as _self is simply a reference to + * // this, if anyone overrides myFunction() the overridden will be called first + * // as the normal JavaScript method resolution will occur and the defined + * // _self.initialize() function is actually gets removed from the instance and + * // a proxy prototype version is created to reference the created method. + * _self.initialize(); + * }); + * } + * } + * ``` + * @typeparam DPType This is the generic type of the class, used to keep intellisense valid + * @typeparam DPCls The type that contains the prototype of the current class + * @param theClass - This is the current class instance which contains the prototype for the current class + * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. + * @param delegateFunc - The callback function (closure) that will create the dynamic function + * @param options - Additional options to configure how the dynamic prototype operates + */ + function dynamicProto(theClass, target, delegateFunc, options) { + // Make sure that the passed theClass argument looks correct + if (!(0, ts_utils_1.objHasOwnProperty)(theClass, Prototype)) { + _throwTypeError("theClass is an invalid class definition."); + } + // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) + var classProto = theClass[Prototype]; + if (!_checkPrototype(classProto, target)) { + _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); + } + var className = null; + if ((0, ts_utils_1.objHasOwnProperty)(classProto, DynClassName)) { + // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) + className = classProto[DynClassName]; + } + else { + // As not all browser support name on the prototype creating a unique dynamic one if we have not already + // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance + // function table lookup. + className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; + _gblInst.n++; + classProto[DynClassName] = className; + } + var perfOptions = dynamicProto[DynProtoDefaultOptions]; + var useBaseInst = !!perfOptions[strUseBaseInst]; + if (useBaseInst && options && options[strUseBaseInst] !== undefined) { + useBaseInst = !!options[strUseBaseInst]; + } + // Get the current instance functions + var instFuncs = _getInstanceFuncs(target); + // Get all of the functions for any base instance (before they are potentially overridden) + var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); + // Execute the delegate passing in both the current target "this" and "base" function references + // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support + delegateFunc(target, baseFuncs); + // Don't allow setting instance functions for older IE instances or in SSR environments + var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isServerSideRender(); + if (setInstanceFunc && options) { + setInstanceFunc = !!options[strSetInstFuncs]; + } + // Populate the Prototype for any overridden instance functions + _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); + } + exports.default = dynamicProto; + /** + * Exposes the default global options to allow global configuration, if the global values are disabled these will override + * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose + * their internal usage of dynamic proto. + */ + dynamicProto[DynProtoDefaultOptions] = _gblInst.o; +}); +/// +define("test/DynamicProto.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoDefaultTests = void 0; + var InheritTest1 = /** @class */ (function () { + function InheritTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritTest1; + }()); + var InheritTest2 = /** @class */ (function (_super) { + __extends(InheritTest2, _super); + function InheritTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritTest2; + }(InheritTest1)); + var InheritTest3 = /** @class */ (function (_super) { + __extends(InheritTest3, _super); + function InheritTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritTest3; + }(InheritTest2)); + var DynInheritTest1 = /** @class */ (function () { + function DynInheritTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_1.default)(DynInheritTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }); + } + return DynInheritTest1; + }()); + var InheritTest4 = /** @class */ (function (_super) { + __extends(InheritTest4, _super); + function InheritTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritTest4; + }(DynInheritTest1)); + var InheritTest5 = /** @class */ (function (_super) { + __extends(InheritTest5, _super); + function InheritTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritTest5; + }(InheritTest4)); + var DynInheritTest2 = /** @class */ (function (_super) { + __extends(DynInheritTest2, _super); + function DynInheritTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_1.default)(DynInheritTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }); + return _this; + } + return DynInheritTest2; + }(InheritTest1)); + var DynInheritTest3 = /** @class */ (function (_super) { + __extends(DynInheritTest3, _super); + function DynInheritTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_1.default)(DynInheritTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }); + return _this; + } + return DynInheritTest3; + }(DynInheritTest2)); + var InheritTest6 = /** @class */ (function (_super) { + __extends(InheritTest6, _super); + function InheritTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritTest6; + }(DynInheritTest2)); + var DynInheritTest4 = /** @class */ (function (_super) { + __extends(DynInheritTest4, _super); + function DynInheritTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_1.default)(DynInheritTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }); + return _this; + } + return DynInheritTest4; + }(InheritTest6)); + var DynInheritTest5 = /** @class */ (function (_super) { + __extends(DynInheritTest5, _super); + function DynInheritTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_1.default)(DynInheritTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }); + return _this; + } + return DynInheritTest5; + }(DynInheritTest1)); + var DynInheritTest6 = /** @class */ (function (_super) { + __extends(DynInheritTest6, _super); + function DynInheritTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_1.default)(DynInheritTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }); + return _this; + } + return DynInheritTest6; + }(DynInheritTest5)); + var InstInherit1 = /** @class */ (function () { + function InstInherit1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInherit1; + }()); + var InstInherit2 = /** @class */ (function (_super) { + __extends(InstInherit2, _super); + function InstInherit2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInherit2; + }(InheritTest2)); + var InheritTest7 = /** @class */ (function (_super) { + __extends(InheritTest7, _super); + function InheritTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritTest7; + }(InstInherit1)); + var DynInheritTest7 = /** @class */ (function (_super) { + __extends(DynInheritTest7, _super); + function DynInheritTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_1.default)(DynInheritTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritTest7; + }(InstInherit1)); + var InstInherit3 = /** @class */ (function (_super) { + __extends(InstInherit3, _super); + function InstInherit3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInherit3; + }(DynInheritTest7)); + var DynInheritTest8 = /** @class */ (function (_super) { + __extends(DynInheritTest8, _super); + function DynInheritTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_1.default)(DynInheritTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }); + return _this; + } + return DynInheritTest8; + }(InstInherit3)); + var BadInstInherit1 = /** @class */ (function (_super) { + __extends(BadInstInherit1, _super); + function BadInstInherit1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInherit1; + }(InstInherit1)); + var DynInheritTest9 = /** @class */ (function (_super) { + __extends(DynInheritTest9, _super); + function DynInheritTest9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_1.default)(DynInheritTest9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }); + return _this; + } + return DynInheritTest9; + }(BadInstInherit1)); + var GoodInstInherit1 = /** @class */ (function (_super) { + __extends(GoodInstInherit1, _super); + function GoodInstInherit1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInherit1; + }(InstInherit1)); + var DynInheritTest10 = /** @class */ (function (_super) { + __extends(DynInheritTest10, _super); + function DynInheritTest10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_1.default)(DynInheritTest10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }); + return _this; + } + return DynInheritTest10; + }(GoodInstInherit1)); + var GoodInstInherit2 = /** @class */ (function (_super) { + __extends(GoodInstInherit2, _super); + function GoodInstInherit2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInherit2; + }(DynInheritTest10)); + var DynamicProtoDefaultTests = /** @class */ (function (_super) { + __extends(DynamicProtoDefaultTests, _super); + function DynamicProtoDefaultTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoDefaultTests.prototype.testInitialize = function () { + }; + DynamicProtoDefaultTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoDefaultTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoDefaultTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "Default: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritTest1(), [ + "InheritTest1()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInherit1(), [ + "InstInherit1()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInherit2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInherit3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInherit1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTest9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInherit1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTest10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInherit2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + ]); + } + }); + }; + return DynamicProtoDefaultTests; + }(TestClass)); + exports.DynamicProtoDefaultTests = DynamicProtoDefaultTests; +}); +/// +define("test/DynamicProtoMultipleCall.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoMultipleCallTests = void 0; + var InheritMultipleCallTest1 = /** @class */ (function () { + function InheritMultipleCallTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritMultipleCallTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritMultipleCallTest1; + }()); + var InheritMultipleCallTest2 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest2, _super); + function InheritMultipleCallTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritMultipleCallTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritMultipleCallTest2; + }(InheritMultipleCallTest1)); + var InheritMultipleCallTest3 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest3, _super); + function InheritMultipleCallTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritMultipleCallTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritMultipleCallTest3; + }(InheritMultipleCallTest2)); + var DynInheritMultipleCallTest1 = /** @class */ (function () { + function DynInheritMultipleCallTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }); + } + return DynInheritMultipleCallTest1; + }()); + var InheritMultipleCallTest4 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest4, _super); + function InheritMultipleCallTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritMultipleCallTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritMultipleCallTest4; + }(DynInheritMultipleCallTest1)); + var InheritMultipleCallTest5 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest5, _super); + function InheritMultipleCallTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritMultipleCallTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritMultipleCallTest5; + }(InheritMultipleCallTest4)); + var DynInheritMultipleCallTest2 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest2, _super); + function DynInheritMultipleCallTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest2; + }(InheritMultipleCallTest1)); + var DynInheritMultipleCallTest3 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest3, _super); + function DynInheritMultipleCallTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest3; + }(DynInheritMultipleCallTest2)); + var InheritMultipleCallTest6 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest6, _super); + function InheritMultipleCallTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritMultipleCallTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritMultipleCallTest6; + }(DynInheritMultipleCallTest2)); + var DynInheritMultipleCallTest4 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest4, _super); + function DynInheritMultipleCallTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest4; + }(InheritMultipleCallTest6)); + var DynInheritMultipleCallTest5 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest5, _super); + function DynInheritMultipleCallTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest5; + }(DynInheritMultipleCallTest1)); + var DynInheritMultipleCallTest6 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest6, _super); + function DynInheritMultipleCallTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest6; + }(DynInheritMultipleCallTest5)); + var InstInheritMultipleCall1 = /** @class */ (function () { + function InstInheritMultipleCall1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInheritMultipleCall1; + }()); + var InstInheritMultipleCall2 = /** @class */ (function (_super) { + __extends(InstInheritMultipleCall2, _super); + function InstInheritMultipleCall2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInheritMultipleCall2; + }(InheritMultipleCallTest2)); + var InheritMultipleCallTest7 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest7, _super); + function InheritMultipleCallTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritMultipleCallTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritMultipleCallTest7; + }(InstInheritMultipleCall1)); + var DynInheritMultipleCallTest7 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest7, _super); + function DynInheritMultipleCallTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest7; + }(InstInheritMultipleCall1)); + var InstInheritMultipleCall3 = /** @class */ (function (_super) { + __extends(InstInheritMultipleCall3, _super); + function InstInheritMultipleCall3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInheritMultipleCall3; + }(DynInheritMultipleCallTest7)); + var DynInheritMultipleCallTest8 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest8, _super); + function DynInheritMultipleCallTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest8; + }(InstInheritMultipleCall3)); + var BadInstInheritMultipleCall1 = /** @class */ (function (_super) { + __extends(BadInstInheritMultipleCall1, _super); + function BadInstInheritMultipleCall1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInheritMultipleCall1; + }(InstInheritMultipleCall1)); + var DynInheritTestMultipleCall9 = /** @class */ (function (_super) { + __extends(DynInheritTestMultipleCall9, _super); + function DynInheritTestMultipleCall9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_2.default)(DynInheritTestMultipleCall9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }); + return _this; + } + return DynInheritTestMultipleCall9; + }(BadInstInheritMultipleCall1)); + var GoodInstInheritMultipleCall1 = /** @class */ (function (_super) { + __extends(GoodInstInheritMultipleCall1, _super); + function GoodInstInheritMultipleCall1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInheritMultipleCall1; + }(InstInheritMultipleCall1)); + var DynInheritTestMultipleCall10 = /** @class */ (function (_super) { + __extends(DynInheritTestMultipleCall10, _super); + function DynInheritTestMultipleCall10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_2.default)(DynInheritTestMultipleCall10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }); + return _this; + } + return DynInheritTestMultipleCall10; + }(GoodInstInheritMultipleCall1)); + var GoodInstInheritMultipleCall2 = /** @class */ (function (_super) { + __extends(GoodInstInheritMultipleCall2, _super); + function GoodInstInheritMultipleCall2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInheritMultipleCall2; + }(DynInheritTestMultipleCall10)); + var DynamicProtoMultipleCallTests = /** @class */ (function (_super) { + __extends(DynamicProtoMultipleCallTests, _super); + function DynamicProtoMultipleCallTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoMultipleCallTests.prototype.testInitialize = function () { + }; + DynamicProtoMultipleCallTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoMultipleCallTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + theTest.testFunction(); + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoMultipleCallTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "MultipleCall: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritMultipleCallTest1(), [ + "InheritTest1()", + "InheritTest1.test()", + "InheritTest1.test()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritMultipleCallTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritMultipleCallTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritMultipleCallTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritMultipleCallTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritMultipleCallTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()", + "DynInheritTest1.test()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritMultipleCallTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritMultipleCallTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritMultipleCallTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritMultipleCallTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritMultipleCallTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritMultipleCallTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInheritMultipleCall1(), [ + "InstInherit1()", + "InstInherit1.test()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInheritMultipleCall2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritMultipleCallTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritMultipleCallTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInheritMultipleCall3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritMultipleCallTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInheritMultipleCall1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTestMultipleCall9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInheritMultipleCall1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTestMultipleCall10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInheritMultipleCall2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()" + ]); + } + }); + }; + return DynamicProtoMultipleCallTests; + }(TestClass)); + exports.DynamicProtoMultipleCallTests = DynamicProtoMultipleCallTests; +}); +/// +define("test/DynamicProtoNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_3) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoNoInstTests = void 0; + var InheritNoInstTest1 = /** @class */ (function () { + function InheritNoInstTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritNoInstTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritNoInstTest1; + }()); + var InheritNoInstTest2 = /** @class */ (function (_super) { + __extends(InheritNoInstTest2, _super); + function InheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritNoInstTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritNoInstTest2; + }(InheritNoInstTest1)); + var InheritNoInstTest3 = /** @class */ (function (_super) { + __extends(InheritNoInstTest3, _super); + function InheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritNoInstTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritNoInstTest3; + }(InheritNoInstTest2)); + var DynInheritNoInstTest1 = /** @class */ (function () { + function DynInheritNoInstTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }, { setInstFuncs: false }); + } + return DynInheritNoInstTest1; + }()); + var InheritNoInstTest4 = /** @class */ (function (_super) { + __extends(InheritNoInstTest4, _super); + function InheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritNoInstTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritNoInstTest4; + }(DynInheritNoInstTest1)); + var InheritNoInstTest5 = /** @class */ (function (_super) { + __extends(InheritNoInstTest5, _super); + function InheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritNoInstTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritNoInstTest5; + }(InheritNoInstTest4)); + var DynInheritNoInstTest2 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest2, _super); + function DynInheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest2; + }(InheritNoInstTest1)); + var DynInheritNoInstTest3 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest3, _super); + function DynInheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest3; + }(DynInheritNoInstTest2)); + var InheritNoInstTest6 = /** @class */ (function (_super) { + __extends(InheritNoInstTest6, _super); + function InheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritNoInstTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritNoInstTest6; + }(DynInheritNoInstTest2)); + var DynInheritNoInstTest4 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest4, _super); + function DynInheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest4; + }(InheritNoInstTest6)); + var DynInheritNoInstTest5 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest5, _super); + function DynInheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest5; + }(DynInheritNoInstTest1)); + var DynInheritNoInstTest6 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest6, _super); + function DynInheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest6; + }(DynInheritNoInstTest5)); + var InstInheritNoInst1 = /** @class */ (function () { + function InstInheritNoInst1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInheritNoInst1; + }()); + var InstInheritNoInst2 = /** @class */ (function (_super) { + __extends(InstInheritNoInst2, _super); + function InstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInheritNoInst2; + }(InheritNoInstTest2)); + var InheritNoInstTest7 = /** @class */ (function (_super) { + __extends(InheritNoInstTest7, _super); + function InheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritNoInstTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritNoInstTest7; + }(InstInheritNoInst1)); + var DynInheritNoInstTest7 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest7, _super); + function DynInheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritNoInstTest7; + }(InstInheritNoInst1)); + var InstInheritNoInst3 = /** @class */ (function (_super) { + __extends(InstInheritNoInst3, _super); + function InstInheritNoInst3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInheritNoInst3; + }(DynInheritNoInstTest7)); + var DynInheritNoInstTest8 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest8, _super); + function DynInheritNoInstTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest8; + }(InstInheritNoInst3)); + var BadInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(BadInstInheritNoInst1, _super); + function BadInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst9 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst9, _super); + function DynInheritTestNoInst9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_3.default)(DynInheritTestNoInst9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst9; + }(BadInstInheritNoInst1)); + var GoodInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst1, _super); + function GoodInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst10 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst10, _super); + function DynInheritTestNoInst10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_3.default)(DynInheritTestNoInst10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst10; + }(GoodInstInheritNoInst1)); + var GoodInstInheritNoInst2 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst2, _super); + function GoodInstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInheritNoInst2; + }(DynInheritTestNoInst10)); + var DynamicProtoNoInstTests = /** @class */ (function (_super) { + __extends(DynamicProtoNoInstTests, _super); + function DynamicProtoNoInstTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoNoInstTests.prototype.testInitialize = function () { + }; + DynamicProtoNoInstTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoNoInstTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "NoInst: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritNoInstTest1(), [ + "InheritTest1()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritNoInstTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritNoInstTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritNoInstTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritNoInstTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritNoInstTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInheritNoInst1(), [ + "InstInherit1()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInheritNoInst2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritNoInstTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInheritNoInst3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + ]); + } + }); + }; + return DynamicProtoNoInstTests; + }(TestClass)); + exports.DynamicProtoNoInstTests = DynamicProtoNoInstTests; +}); +/// +define("test/DynamicProtoMultipleNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_4) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoMultipleNoInstTests = void 0; + var InheritNoInstTest1 = /** @class */ (function () { + function InheritNoInstTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritNoInstTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritNoInstTest1; + }()); + var InheritNoInstTest2 = /** @class */ (function (_super) { + __extends(InheritNoInstTest2, _super); + function InheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritNoInstTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritNoInstTest2; + }(InheritNoInstTest1)); + var InheritNoInstTest3 = /** @class */ (function (_super) { + __extends(InheritNoInstTest3, _super); + function InheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritNoInstTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritNoInstTest3; + }(InheritNoInstTest2)); + var DynInheritNoInstTest1 = /** @class */ (function () { + function DynInheritNoInstTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }, { setInstFuncs: false }); + } + return DynInheritNoInstTest1; + }()); + var InheritNoInstTest4 = /** @class */ (function (_super) { + __extends(InheritNoInstTest4, _super); + function InheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritNoInstTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritNoInstTest4; + }(DynInheritNoInstTest1)); + var InheritNoInstTest5 = /** @class */ (function (_super) { + __extends(InheritNoInstTest5, _super); + function InheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritNoInstTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritNoInstTest5; + }(InheritNoInstTest4)); + var DynInheritNoInstTest2 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest2, _super); + function DynInheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest2; + }(InheritNoInstTest1)); + var DynInheritNoInstTest3 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest3, _super); + function DynInheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest3; + }(DynInheritNoInstTest2)); + var InheritNoInstTest6 = /** @class */ (function (_super) { + __extends(InheritNoInstTest6, _super); + function InheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritNoInstTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritNoInstTest6; + }(DynInheritNoInstTest2)); + var DynInheritNoInstTest4 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest4, _super); + function DynInheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest4; + }(InheritNoInstTest6)); + var DynInheritNoInstTest5 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest5, _super); + function DynInheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest5; + }(DynInheritNoInstTest1)); + var DynInheritNoInstTest6 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest6, _super); + function DynInheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest6; + }(DynInheritNoInstTest5)); + var InstInheritNoInst1 = /** @class */ (function () { + function InstInheritNoInst1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInheritNoInst1; + }()); + var InstInheritNoInst2 = /** @class */ (function (_super) { + __extends(InstInheritNoInst2, _super); + function InstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInheritNoInst2; + }(InheritNoInstTest2)); + var InheritNoInstTest7 = /** @class */ (function (_super) { + __extends(InheritNoInstTest7, _super); + function InheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritNoInstTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritNoInstTest7; + }(InstInheritNoInst1)); + var DynInheritNoInstTest7 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest7, _super); + function DynInheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritNoInstTest7; + }(InstInheritNoInst1)); + var InstInheritNoInst3 = /** @class */ (function (_super) { + __extends(InstInheritNoInst3, _super); + function InstInheritNoInst3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInheritNoInst3; + }(DynInheritNoInstTest7)); + var DynInheritNoInstTest8 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest8, _super); + function DynInheritNoInstTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest8; + }(InstInheritNoInst3)); + var BadInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(BadInstInheritNoInst1, _super); + function BadInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst9 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst9, _super); + function DynInheritTestNoInst9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_4.default)(DynInheritTestNoInst9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst9; + }(BadInstInheritNoInst1)); + var GoodInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst1, _super); + function GoodInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst10 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst10, _super); + function DynInheritTestNoInst10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_4.default)(DynInheritTestNoInst10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst10; + }(GoodInstInheritNoInst1)); + var GoodInstInheritNoInst2 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst2, _super); + function GoodInstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInheritNoInst2; + }(DynInheritTestNoInst10)); + var DynamicProtoMultipleNoInstTests = /** @class */ (function (_super) { + __extends(DynamicProtoMultipleNoInstTests, _super); + function DynamicProtoMultipleNoInstTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoMultipleNoInstTests.prototype.testInitialize = function () { + }; + DynamicProtoMultipleNoInstTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoMultipleNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoMultipleNoInstTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "NoInst: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritNoInstTest1(), [ + "InheritTest1()", + "InheritTest1.test()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritNoInstTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritNoInstTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritNoInstTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritNoInstTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritNoInstTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInheritNoInst1(), [ + "InstInherit1()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInheritNoInst2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritNoInstTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInheritNoInst3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()" + ]); + } + }); + }; + return DynamicProtoMultipleNoInstTests; + }(TestClass)); + exports.DynamicProtoMultipleNoInstTests = DynamicProtoMultipleNoInstTests; +}); +/// +define("test/SecurityCheck.Tests", ["require", "exports", "@nevware21/ts-utils", "src/DynamicProto"], function (require, exports, ts_utils_2, DynamicProto_5) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SecurityCheckTests = void 0; + var HackClass = /** @class */ (function () { + function HackClass() { + this.hello = "world"; + } + return HackClass; + }()); + var BadInstClass = /** @class */ (function () { + function BadInstClass() { + this._dynInstFuncs = {}; + this._dynInstFuncs = Object.prototype; + } + return BadInstClass; + }()); + var BadProxyInstClass = /** @class */ (function () { + function BadProxyInstClass() { + this._dynInstFuncs = {}; + this._dynInstFuncs = new Proxy(this, { + get: function (target, prop) { + if (typeof prop === "string" && prop.startsWith("_dynCls")) { + return Object.prototype; + } + return target[prop]; + } + }); + } + return BadProxyInstClass; + }()); + var SecurityCheckTests = /** @class */ (function (_super) { + __extends(SecurityCheckTests, _super); + function SecurityCheckTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + SecurityCheckTests.prototype.testInitialize = function () { + }; + SecurityCheckTests.prototype.registerTests = function () { + this.testCase({ + name: "Try to update Object.prototype directly", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(Object, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(Object.prototype, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(Object, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with a HackClass instance and __proto__ property", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self.__proto__ = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with a HackClass instance and __proto__ function", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self.__proto__ = function () { + testHack: true; + }; + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + Object.defineProperty(self, "__proto__", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + Object.defineProperty(self, "__proto__", { + value: function () { + testHack: true; + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype using HackClass instance with a __proto__ function", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self.__proto__ = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with HackClass and an object instance", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self.__proto__ = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + Object.defineProperty(self, "__proto__", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + }); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self["__proto__['hacked']"] = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + Object.defineProperty(self, "__proto__['hacked']", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with a HackClass instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self.__proto__ = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly using defineProperty with a HackClass instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + Object.defineProperty(self, "__proto__", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly with a null prototype instance", + test: function () { + var a = {}; + var theInstance = Object.create(a); + try { + (0, DynamicProto_5.default)(theInstance, a, function (_self, base) { + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly with an a prototype instance", + test: function () { + var a = {}; + var theInstance = Object.create(a); + try { + (0, DynamicProto_5.default)(Object.getPrototypeOf(theInstance), a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { + get: function (target, prop) { + if (typeof prop === "string" && prop.startsWith("_dynCls")) { + return Object.prototype; + } + return target[prop]; + } + }); + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var className = _self["_dynClass"]; + var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); + // Change the return class prototype to be Object.prototype + classProto["_dynCls" + className] = Object.prototype; + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + try { + (0, ts_utils_2.objGetPrototypeOf)(base).testHack = true; + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { + get: function (target, prop) { + if (typeof prop === "string" && prop.startsWith("_dynCls")) { + return Array.prototype; + } + return target[prop]; + } + }); + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Array.prototype"); + }; + }); + QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); + } + }); + this.testCase({ + name: "Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var className = _self["_dynClass"]; + var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); + // Change the return class prototype to be Object.prototype + classProto["_dynCls" + className] = Array.prototype; + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Array.prototype"); + }; + }); + QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype with a BadInstClass instance", + test: function () { + var a = new BadInstClass(); + (0, DynamicProto_5.default)(BadInstClass, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype with a BadProxyInstClass instance", + test: function () { + var a = new BadProxyInstClass(); + (0, DynamicProto_5.default)(BadProxyInstClass, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); + } + }); + }; + return SecurityCheckTests; + }(TestClass)); + exports.SecurityCheckTests = SecurityCheckTests; +}); +define("test/Selenium/DynamicProtoTests", ["require", "exports", "test/DynamicProto.Tests", "test/DynamicProtoMultipleCall.Tests", "test/DynamicProtoNoInst.Tests", "test/DynamicProtoMultipleNoInst.Tests", "test/SecurityCheck.Tests"], function (require, exports, DynamicProto_Tests_1, DynamicProtoMultipleCall_Tests_1, DynamicProtoNoInst_Tests_1, DynamicProtoMultipleNoInst_Tests_1, SecurityCheck_Tests_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.runTests = void 0; + function runTests() { + new DynamicProto_Tests_1.DynamicProtoDefaultTests("Default").registerTests(); + new DynamicProtoMultipleCall_Tests_1.DynamicProtoMultipleCallTests("Multiple").registerTests(); + new DynamicProtoNoInst_Tests_1.DynamicProtoNoInstTests("SetInst").registerTests(); + new DynamicProtoMultipleNoInst_Tests_1.DynamicProtoMultipleNoInstTests("Multiple SetInst").registerTests(); + new SecurityCheck_Tests_1.SecurityCheckTests("Security Checks").registerTests(); + } + exports.runTests = runTests; +}); +//# sourceMappingURL=dynamicprototests.js.map \ No newline at end of file diff --git a/lib/test/Selenium/dynamicprototests.js.map b/lib/test/Selenium/dynamicprototests.js.map new file mode 100644 index 0000000..3b750f5 --- /dev/null +++ b/lib/test/Selenium/dynamicprototests.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicprototests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/DynamicProto.ts","../DynamicProto.Tests.ts","../DynamicProtoMultipleCall.Tests.ts","../DynamicProtoNoInst.Tests.ts","../DynamicProtoMultipleNoInst.Tests.ts","../SecurityCheck.Tests.ts","DynamicProtoTests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA+C;AAE/C;;;;GAIG;AACH;IAAA;IA2IA,CAAC;IA1IE;;;;;;;;;;;OAWG;IACY,gBAAS,GAAvB,UAAwB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAChE,OAAO,SAAS,CAAC,MAAM,EAAE,QAAQ,E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CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;wBACvE,CAAC,CAAA;oBACL,CAAC,CAAC,CAAC;oBAEH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,2CAA2C,CAAC,CAAC;oBAChH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,2CAA2C,CAAC,CAAC;gBACpH,CAAC;aACJ,CAAC,CAAC;QAEP,CAAC;QACL,yBAAC;IAAD,CAAC,AAnnBD,CAAwC,SAAS,GAmnBhD;IAnnBY,gDAAkB;;;;;;IChC/B,SAAgB,QAAQ;QACpB,IAAI,6CAAwB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;QACxD,IAAI,8DAA6B,CAAC,UAAU,CAAC,CAAC,aAAa,EAAE,CAAC;QAC9D,IAAI,kDAAuB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;QACvD,IAAI,kEAA+B,CAAC,kBAAkB,CAAC,CAAC,aAAa,EAAE,CAAC;QACxE,IAAI,wCAAkB,CAAC,iBAAiB,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9D,CAAC;IAND,4BAMC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\n\ninterface DynamicGlobalSettings {\n /**\n * Stores the global options which will also be exposed on the runtime global\n */\n o: IDynamicProtoOpts,\n\n /**\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\n * @ignore\n */ \n n: number\n};\n\nconst UNDEFINED = \"undefined\";\n\n/**\n * Helper to check if we're running in a server-side rendering environment\n * like Node.js or Cloudflare Workers\n * @ignore\n */\nfunction _isServerSideRender(): boolean {\n const gbl = getGlobal();\n // Check for common server-side environments\n // 1. Missing window or document (Node.js, some SSR frameworks)\n // 2. Cloudflare Worker specific environment\n return (typeof gbl.window === UNDEFINED || \n typeof gbl.document === UNDEFINED ||\n (typeof gbl.navigator !== UNDEFINED && \n typeof gbl.navigator.userAgent !== UNDEFINED && \n gbl.navigator.userAgent.indexOf('Cloudflare-Workers') >= 0));\n}\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Constructor = 'constructor';\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Prototype = 'prototype';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strFunction = 'function';\n\n/**\n * Used to define the name of the instance function lookup table\n * @ignore\n */ \nconst DynInstFuncTable = '_dynInstFuncs';\n \n/**\n * Name used to tag the dynamic prototype function\n * @ignore\n */ \nconst DynProxyTag = '_isDynProxy';\n \n/**\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\n * @ignore\n */ \nconst DynClassName = '_dynClass';\n \n/**\n * Prefix added to the classname to avoid any name clashes with other instance level properties\n * @ignore\n */ \nconst DynClassNamePrefix = '_dynCls$';\n \n/**\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\n * @ignore\n */\nconst DynInstChkTag = '_dynInstChk';\n \n/**\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same \n * tag name as the function level but a different const name for readability only.\n */\nconst DynAllowInstChkTag = DynInstChkTag;\n \n/**\n * The global (imported) instances where the global performance options are stored\n */\nconst DynProtoDefaultOptions = '_dfOpts';\n \n/**\n * Value used as the name of a class when it cannot be determined\n * @ignore\n */ \nconst UnknownValue = '_unknown_';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst str__Proto = \"__proto__\";\n \n/**\n * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\n */\nconst DynProtoBaseProto = \"_dyn\" + str__Proto;\n\n/**\n * Runtime Global holder for dynamicProto settings\n */\nconst DynProtoGlobalSettings = \"__dynProto$Gbl\";\n\n/**\n * Track the current prototype for IE8 as you can't look back to get the prototype\n */\nconst DynProtoCurrent = \"_dynInstProto\";\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strUseBaseInst = 'useBaseInst';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strSetInstFuncs = 'setInstFuncs';\n \nconst Obj = Object;\n\n/**\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\n * @ignore\n */\nlet _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\n\n/**\n * Pre-lookup to check for the existence of this function\n */\nlet _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\n\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\nlet _gbl = getGlobal();\nlet _gblInst: DynamicGlobalSettings = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\n o: {\n [strSetInstFuncs]: true,\n [strUseBaseInst]: true\n },\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\n});\n\n/**\n * Helper used to check whether the target is an Object prototype or Array prototype\n * @ignore\n */ \nfunction _isObjectOrArrayPrototype(target:any) {\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\n}\n\n/**\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\n * @ignore\n */ \nfunction _isObjectArrayOrFunctionPrototype(target:any) {\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\n}\n\n/**\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\n * @ignore\n */ \nfunction _getObjProto(target:any) {\n let newProto;\n\n if (target) {\n // This method doesn't exist in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n return _objGetPrototypeOf(target);\n }\n\n let curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\n\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\n newProto = target[DynProtoBaseProto] || curProto;\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\n target[DynProtoCurrent] = curProto;\n }\n }\n\n return newProto;\n}\n\n/**\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\n * are not enumerable.\n * @param target \n */\nfunction _forEachProp(target: any, func: (name: string) => void) {\n let props: string[] = [];\n if (_objGetOwnProps) {\n props = _objGetOwnProps(target);\n } else {\n for (let name in target) {\n if (typeof name === \"string\" && objHasOwnProperty(target, name)) {\n props.push(name);\n }\n }\n }\n\n if (props && props.length > 0) {\n for (let lp = 0; lp < props.length; lp++) {\n func(props[lp]);\n }\n }\n}\n\n/**\n * Helper function to check whether the provided function name is a potential candidate for dynamic\n * callback and prototype generation.\n * @param target The target object, may be a prototype or class object\n * @param funcName The function name\n * @param skipOwn Skips the check for own property\n * @ignore\n */\nfunction _isDynamicCandidate(target:any, funcName:string, skipOwn:boolean) {\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);\n}\n\n/**\n * Helper to throw a TypeError exception\n * @param message the message\n * @ignore\n */\nfunction _throwTypeError(message:string) {\n throwTypeError(\"DynamicProto: \" + message);\n}\n\n/**\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does \n * not return any inherited functions\n * @param thisTarget The object to get the instance functions from\n * @ignore\n */\nfunction _getInstanceFuncs(thisTarget:any): any {\n // Get the base proto\n var instFuncs = objCreate(null);\n\n // Save any existing instance functions\n _forEachProp(thisTarget, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\n // Create an instance callback for passing the base function to the caller\n instFuncs[name] = thisTarget[name];\n }\n });\n\n return instFuncs;\n}\n\n/**\n * Returns whether the value is included in the array\n * @param values The array of values\n * @param value The value\n */\nfunction _hasVisited(values:any[], value:any) {\n for (let lp = values.length - 1; lp >= 0; lp--) {\n if (values[lp] === value) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\n * @param target The current instance\n * @ignore\n */\nfunction _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseInst:boolean): any {\n function _instFuncProxy(target:any, funcHost: any, funcName: string) {\n let theFunc = funcHost[funcName];\n if (theFunc[DynProxyTag] && useBaseInst) {\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\n let instFuncTable = target[DynInstFuncTable] || {};\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\n }\n }\n\n return function() {\n // eslint-disable-next-line prefer-rest-params\n return theFunc.apply(target, arguments);\n };\n }\n\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\n var baseFuncs = objCreate(null);\n _forEachProp(instFuncs, (name) => {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\n });\n \n // Get the base prototype functions\n var baseProto = _getObjProto(classProto);\n let visited:any[] = [];\n\n // Don't include base object functions for Object, Array or Function\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\n // look for prototype functions\n _forEachProp(baseProto, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\n // the Object prototype methods while bypassing the check\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\n }\n });\n\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(baseProto);\n baseProto = _getObjProto(baseProto);\n }\n\n return baseFuncs;\n}\n\nfunction _getInstFunc(target: any, funcName: string, proto: any, currentDynProtoProxy: any) {\n let instFunc = null;\n\n // We need to check whether the class name is defined directly on this prototype otherwise\n // it will walk the proto chain and return any parent proto classname.\n if (target && objHasOwnProperty(proto, DynClassName)) {\n\n let instFuncTable = target[DynInstFuncTable] || objCreate(null);\n instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[funcName];\n\n if (!instFunc) {\n // Avoid stack overflow from recursive calling the same function\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\n }\n\n // We have the instance function, lets check it we can speed up further calls\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\n // If the instance already has an instance function we can't replace it\n let canAddInst = !objHasOwnProperty(target, funcName);\n\n // Get current prototype\n let objProto = _getObjProto(target);\n let visited:any[] = [];\n\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\n let protoFunc = objProto[funcName];\n if (protoFunc) {\n canAddInst = (protoFunc === currentDynProtoProxy);\n break;\n }\n\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\n visited.push(objProto);\n objProto = _getObjProto(objProto);\n }\n\n try {\n if (canAddInst) {\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\n // so it's safe to directly assign for any subsequent calls (for better performance)\n target[funcName] = instFunc;\n }\n\n // Block further attempts to set the instance function for any\n instFunc[DynInstChkTag] = 1;\n } catch (e) {\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\n // And set a flag so we don't try again for any function\n instFuncTable[DynAllowInstChkTag] = false;\n }\n }\n }\n\n return instFunc;\n}\n\nfunction _getProtoFunc(funcName: string, proto: any, currentDynProtoProxy: any) {\n let protoFunc = proto[funcName];\n\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\n if (protoFunc === currentDynProtoProxy) {\n // It is so lookup the base prototype\n protoFunc = _getObjProto(proto)[funcName];\n }\n\n if (typeof protoFunc !== strFunction) {\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\n }\n\n return protoFunc;\n}\n\n/**\n * Add the required dynamic prototype methods to the the class prototype\n * @param proto - The class prototype\n * @param className - The instance classname \n * @param target - The target instance\n * @param baseInstFuncs - The base instance functions\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\n * @ignore\n */\nfunction _populatePrototype(proto:any, className:string, target:any, baseInstFuncs:any, setInstanceFunc:boolean) {\n function _createDynamicPrototype(proto:any, funcName:string) {\n let dynProtoProxy = function() {\n // Use the instance or prototype function\n let instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\n // eslint-disable-next-line prefer-rest-params\n return instFunc.apply(this, arguments);\n };\n \n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\n // via which can dynamically replace the prototype function reference)\n (dynProtoProxy as any)[DynProxyTag] = 1;\n return dynProtoProxy;\n }\n \n if (!_isObjectOrArrayPrototype(proto)) {\n let instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);\n if (!_isObjectOrArrayPrototype(instFuncTable)) {\n let instFuncs = instFuncTable[className] = (instFuncTable[className] || objCreate(null)); // fetch and assign if as it may not exist yet\n\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\n }\n\n if (!_isObjectOrArrayPrototype(instFuncs)) {\n _forEachProp(target, (name) => {\n // Only add overridden functions\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name] ) {\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\n instFuncs[name] = target[name];\n delete target[name];\n \n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\n if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\n proto[name] = _createDynamicPrototype(proto, name);\n }\n }\n });\n }\n }\n }\n}\n\n/**\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\n * @param classProto The class prototype instance\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\n * @ignore\n */\nfunction _checkPrototype(classProto:any, thisTarget:any) {\n // This method doesn't existing in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\n let visited:any[] = [];\n let thisProto = _getObjProto(thisTarget);\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\n if (thisProto === classProto) {\n return true;\n }\n\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(thisProto);\n thisProto = _getObjProto(thisProto);\n }\n\n return false;\n }\n\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\n return true;\n}\n\n/**\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\n * @param target \n * @param unknownValue \n * @ignore\n */\nfunction _getObjName(target:any, unknownValue?:string) {\n if (objHasOwnProperty(target, Prototype)) {\n // Look like a prototype\n return target.name || unknownValue || UnknownValue\n }\n\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\n}\n\n/**\n * Interface to define additional configuration options to control how the dynamic prototype functions operate.\n */\nexport interface IDynamicProtoOpts {\n\n /**\n * Should the dynamic prototype attempt to set an instance function for instances that do not already have an\n * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function.\n */\n setInstFuncs: boolean,\n\n /**\n * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions\n * and bypass the prototype lookups. Defaults to true.\n */\n useBaseInst?: boolean\n}\n\n/**\n * The delegate signature for the function used as the callback for dynamicProto() \n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even \n * though it is only a proxy that only contains the functions \n * @param theTarget This is the real \"this\" of the current target object\n * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the \"this\" instance before\n * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the \"super\" keyword.\n */\nexport type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPType) => void;\n\n/**\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\n * - Saves references to all defined base class functions\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is \n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\n * ### Usage\n * ```typescript\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\n * class ExampleClass extends BaseClass {\n * constructor() {\n * dynamicProto(ExampleClass, this, (_self, base) => {\n * // This will define a function that will be converted to a prototype function\n * _self.newFunc = () => {\n * // Access any \"this\" instance property \n * if (_self.someProperty) {\n * ...\n * }\n * }\n * // This will define a function that will be converted to a prototype function\n * _self.myFunction = () => {\n * // Access any \"this\" instance property\n * if (_self.someProperty) {\n * // Call the base version of the function that we are overriding\n * base.myFunction();\n * }\n * ...\n * }\n * _self.initialize = () => {\n * ...\n * }\n * // Warnings: While the following will work as _self is simply a reference to\n * // this, if anyone overrides myFunction() the overridden will be called first\n * // as the normal JavaScript method resolution will occur and the defined\n * // _self.initialize() function is actually gets removed from the instance and\n * // a proxy prototype version is created to reference the created method.\n * _self.initialize();\n * });\n * }\n * }\n * ```\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\n * @typeparam DPCls The type that contains the prototype of the current class\n * @param theClass - This is the current class instance which contains the prototype for the current class\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\n * @param options - Additional options to configure how the dynamic prototype operates\n */\nexport default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void {\n // Make sure that the passed theClass argument looks correct\n if (!objHasOwnProperty(theClass, Prototype)) {\n _throwTypeError(\"theClass is an invalid class definition.\");\n }\n\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\n let classProto = theClass[Prototype];\n if (!_checkPrototype(classProto, target)) {\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\n }\n\n let className = null;\n if (objHasOwnProperty(classProto, DynClassName)) {\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\n className = classProto[DynClassName];\n } else {\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\n // function table lookup.\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _gblInst.n ;\n _gblInst.n++;\n classProto[DynClassName] = className;\n }\n\n let perfOptions = dynamicProto[DynProtoDefaultOptions];\n let useBaseInst = !!perfOptions[strUseBaseInst];\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\n useBaseInst = !!options[strUseBaseInst];\n }\n\n // Get the current instance functions\n let instFuncs = _getInstanceFuncs(target);\n\n // Get all of the functions for any base instance (before they are potentially overridden)\n let baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\n\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\n delegateFunc(target, baseFuncs as DPType);\n\n // Don't allow setting instance functions for older IE instances or in SSR environments\n let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isServerSideRender();\n if (setInstanceFunc && options) {\n setInstanceFunc = !!options[strSetInstFuncs];\n }\n\n // Populate the Prototype for any overridden instance functions\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\n}\n\n/**\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\n * their internal usage of dynamic proto.\n */\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritTest3 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritTest4 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritTest5 extends InheritTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest3 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritTest6 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritTest4 extends InheritTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest5 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest6 extends DynInheritTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInherit1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInherit2 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInherit3 extends DynInheritTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritTest8 extends InstInherit3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest9 extends BadInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTest9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest10 extends GoodInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTest10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit2 extends DynInheritTest10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoDefaultTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"Default: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInherit1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInherit2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInherit3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInherit1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTest9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInherit1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTest10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInherit2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritMultipleCallTest3 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritMultipleCallTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest4 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritMultipleCallTest5 extends InheritMultipleCallTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritMultipleCallTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest3 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritMultipleCallTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest6 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest4 extends InheritMultipleCallTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritMultipleCallTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest5 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritMultipleCallTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest6 extends DynInheritMultipleCallTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritMultipleCallTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritMultipleCall2 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritMultipleCallTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall3 extends DynInheritMultipleCallTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritMultipleCallTest8 extends InstInheritMultipleCall3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritMultipleCallTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall9 extends BadInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestMultipleCall9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall10 extends GoodInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestMultipleCall10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall2 extends DynInheritTestMultipleCall10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleCallTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"MultipleCall: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritMultipleCallTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritMultipleCallTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritMultipleCallTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritMultipleCallTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritMultipleCallTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritMultipleCallTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritMultipleCall2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritMultipleCallTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritMultipleCallTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritMultipleCall3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritMultipleCallTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestMultipleCall9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestMultipleCall10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritMultipleCall2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport { objGetPrototypeOf } from \"@nevware21/ts-utils\";\nimport dynamicProto from \"../src/DynamicProto\";\n\nclass HackClass {\n public hello: string;\n\n constructor() {\n this.hello = \"world\";\n }\n}\n\n\nclass BadInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = Object.prototype;\n }\n}\n\nclass BadProxyInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = new Proxy(this, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n }\n}\n\nexport class SecurityCheckTests extends TestClass {\n\n public testInitialize() {\n }\n\n public registerTests() {\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object.prototype, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = () => {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: () => {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype using HackClass instance with a __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n self.__proto__ = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n self.__proto__ = {\n testHack: true\n };\n \n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n \n self.prototype = {\n testHack2: true\n };\n });\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self[\"__proto__['hacked']\"] = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__['hacked']\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance\",\n test: () => {\n let a = new HackClass()\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with a HackClass instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with a null prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n\n try {\n dynamicProto(theInstance, a, (_self, base) => {\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with an a prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n try {\n dynamicProto(Object.getPrototypeOf(theInstance), a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Object.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n try {\n objGetPrototypeOf(base).testHack = true;\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Array.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Array.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadInstClass instance\",\n test: () => {\n let a = new BadInstClass();\n\n dynamicProto(BadInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadProxyInstClass instance\",\n test: () => {\n let a = new BadProxyInstClass();\n\n dynamicProto(BadProxyInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n }\n}\n\n","import { DynamicProtoDefaultTests } from '../DynamicProto.Tests';\nimport { DynamicProtoMultipleCallTests } from '../DynamicProtoMultipleCall.Tests';\nimport { DynamicProtoNoInstTests } from '../DynamicProtoNoInst.Tests';\nimport { DynamicProtoMultipleNoInstTests } from '../DynamicProtoMultipleNoInst.Tests';\nimport { SecurityCheckTests } from '../SecurityCheck.Tests';\n\nexport function runTests() {\n new DynamicProtoDefaultTests(\"Default\").registerTests();\n new DynamicProtoMultipleCallTests(\"Multiple\").registerTests();\n new DynamicProtoNoInstTests(\"SetInst\").registerTests();\n new DynamicProtoMultipleNoInstTests(\"Multiple SetInst\").registerTests();\n new SecurityCheckTests(\"Security Checks\").registerTests();\n}\n"]} \ No newline at end of file diff --git a/rollup/test/Selenium/dynamicprotorolluptests.d.ts b/rollup/test/Selenium/dynamicprotorolluptests.d.ts new file mode 100644 index 0000000..76808f3 --- /dev/null +++ b/rollup/test/Selenium/dynamicprotorolluptests.d.ts @@ -0,0 +1,214 @@ +/// +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +declare class Assert { + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static deepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static equal(expected: any, actual: any, message?: string): any; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static notDeepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notEqual(expected: any, actual: any, message?: string): any; + static notPropEqual(expected: any, actual: any, message?: string): any; + static propEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notStrictEqual(expected: any, actual: any, message?: string): any; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + static ok(state: any, message?: string): any; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static strictEqual(expected: any, actual: any, message?: string): any; + /** + * Assertion to test if a callback throws an exception when run. + * + * When testing code that is expected to throw an exception based on a specific set of + * circumstances, use throws() to catch the error object for testing and comparison. + * + * @param block Function to execute + * @param expected Error Object to compare + * @param message A short description of the assertion + */ + static throws(block: () => any, expected: any, message?: string): any; + /** + * @param block Function to execute + * @param message A short description of the assertion + */ + static throws(block: () => any, message?: string): any; +} +/** Defines a test case */ +declare class TestCase { + /** Name to use for the test case */ + name: string; + /** Test case method */ + test: () => void; +} +/** Defines a test case */ +interface TestCaseAsync { + /** Name to use for the test case */ + name: string; + /** time to wait after pre before invoking post and calling start() */ + stepDelay: number; + /** async steps */ + steps: Array<() => void>; +} +declare class TestClass { + constructor(name?: string); + static isPollingStepFlag: string; + /** The instance of the currently running suite. */ + static currentTestClass: TestClass; + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + useFakeTimers: boolean; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + useFakeServer: boolean; + /** Method called before the start of each test method */ + testInitialize(): void; + /** Method called after each test method has completed */ + testCleanup(): void; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + registerTests(): void; + /** Register an async Javascript unit testcase. */ + testCaseAsync(testInfo: TestCaseAsync): void; + /** Register a Javascript unit testcase. */ + testCase(testInfo: TestCase): void; + /** Called when the test is starting. */ + private _testStarting; + /** Called when the test is completed. */ + private _testCompleted; + /**** Sinon methods and properties ***/ + clock: SinonFakeTimers; + server: SinonFakeServer; + sandbox: SinonSandbox; + /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ + spy(): SinonSpy; + /** Spies on the provided function */ + spy(funcToWrap: Function): SinonSpy; + /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ + spy(object: any, methodName: string, func?: Function): SinonSpy; + /** Creates an anonymous stub function. */ + stub(): SinonStub; + /** Stubs all the object's methods. */ + stub(object: any): SinonStub; + /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ + stub(object: any, methodName: string, func?: Function): SinonStub; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + mock(object: any): SinonMock; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; + protected setUserAgent(userAgent: string): void; +} +declare module "src/removeDynamic" { + export interface IDynamicProtoRollupOptions { + tagname?: string; + comment?: string; + sourcemap?: boolean; + } + /** + * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to + * remove the boilerplate code require by typescript to define methods as prototype level while + * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" + * functions from the production code. + */ + export default function dynamicRemove(options?: IDynamicProtoRollupOptions): { + name: string; + renderChunk(code: string, chunk: any): any; + transform: (code: string, id: string) => any; + }; +} +declare module "test/DynamicProtoRollup.Tests" { + export class DynamicProtoRollupTests extends TestClass { + testInitialize(): void; + private visibleNewlines; + private convertNewlines; + private testNoChange; + private doTest; + private testExpected; + private testError; + registerTests(): void; + } +} +declare module "test/Selenium/DynamicProtoRollupTests" { + export function runTests(): void; +} diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js b/rollup/test/Selenium/dynamicprotorolluptests.js new file mode 100644 index 0000000..c9dab61 --- /dev/null +++ b/rollup/test/Selenium/dynamicprotorolluptests.js @@ -0,0 +1,1107 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +var Assert = /** @class */ (function () { + function Assert() { + } + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.deepEqual = function (expected, actual, message) { + return deepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.equal = function (expected, actual, message) { + return equal(actual, expected, message); + }; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.notDeepEqual = function (expected, actual, message) { + return notDeepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notEqual = function (expected, actual, message) { + return notEqual(actual, expected, message); + }; + Assert.notPropEqual = function (expected, actual, message) { + return notPropEqual(actual, expected, message); + }; + Assert.propEqual = function (expected, actual, message) { + return propEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notStrictEqual = function (expected, actual, message) { + return notStrictEqual(actual, expected, message); + }; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + Assert.ok = function (state, message) { + return ok(state, message); + }; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.strictEqual = function (expected, actual, message) { + return strictEqual(actual, expected, message); + }; + Assert.throws = function (block, expected, message) { + return throws(block, expected, message); + }; + return Assert; +}()); +/** Defines a test case */ +var TestCase = /** @class */ (function () { + function TestCase() { + } + return TestCase; +}()); +/// +/// +/// +/// +var TestClass = /** @class */ (function () { + function TestClass(name) { + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + this.useFakeTimers = true; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + this.useFakeServer = true; + QUnit.module(name); + } + /** Method called before the start of each test method */ + TestClass.prototype.testInitialize = function () { + }; + /** Method called after each test method has completed */ + TestClass.prototype.testCleanup = function () { + }; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + TestClass.prototype.registerTests = function () { + }; + /** Register an async Javascript unit testcase. */ + TestClass.prototype.testCaseAsync = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (isNaN(testInfo.stepDelay)) { + throw new Error("Must specify 'stepDelay' period between pre and post"); + } + if (!testInfo.steps) { + throw new Error("Must specify 'steps' to take asynchronously"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function (assert) { + var done = assert.async(); + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + var steps_1 = testInfo.steps; + var trigger_1 = function () { + if (steps_1.length) { + var step = steps_1.shift(); + // The callback which activates the next test step. + var nextTestStepTrigger = function () { + setTimeout(function () { + trigger_1(); + }, testInfo.stepDelay); + }; + // There 2 types of test steps - simple and polling. + // Upon completion of the simple test step the next test step will be called. + // In case of polling test step the next test step is passed to the polling test step, and + // it is responsibility of the polling test step to call the next test step. + try { + if (step[TestClass.isPollingStepFlag]) { + step.call(_this, nextTestStepTrigger); + } + else { + step.call(_this); + nextTestStepTrigger.call(_this); + } + } + catch (e) { + _this._testCompleted(); + Assert.ok(false, e.toString()); + // done is QUnit callback indicating the end of the test + done(); + return; + } + } + else { + _this._testCompleted(); + // done is QUnit callback indicating the end of the test + done(); + } + }; + trigger_1(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + // done is QUnit callback indicating the end of the test + done(); + } + }; + // Register the test with QUnit + QUnit.test(testInfo.name, testMethod); + }; + /** Register a Javascript unit testcase. */ + TestClass.prototype.testCase = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (!testInfo.test) { + throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function () { + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + testInfo.test.call(_this); + _this._testCompleted(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + } + }; + // Register the test with QUnit + test(testInfo.name, testMethod); + }; + /** Called when the test is starting. */ + TestClass.prototype._testStarting = function () { + // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. + var config = sinon.getConfig(sinon.config); + config.useFakeTimers = this.useFakeTimers; + config.useFakeServer = this.useFakeServer; + config.injectInto = config.injectIntoThis && this || config.injectInto; + this.sandbox = sinon.sandbox.create(config); + this.server = this.sandbox.server; + // Allow the derived class to perform test initialization. + this.testInitialize(); + }; + /** Called when the test is completed. */ + TestClass.prototype._testCompleted = function (failed) { + if (failed) { + // Just cleanup the sandbox since the test has already failed. + this.sandbox.restore(); + } + else { + // Verify the sandbox and restore. + this.sandbox.verifyAndRestore(); + } + this.testCleanup(); + // Clear the instance of the currently running suite. + TestClass.currentTestClass = null; + }; + TestClass.prototype.spy = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + TestClass.prototype.stub = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + TestClass.prototype.mock = function (object) { return null; }; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { + if (errorCode === undefined) { + errorCode = 200; + } + request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); + }; + TestClass.prototype.setUserAgent = function (userAgent) { + Object.defineProperty(window.navigator, 'userAgent', { + configurable: true, + get: function () { + return userAgent; + } + }); + }; + TestClass.isPollingStepFlag = "isPollingStep"; + return TestClass; +}()); +// Configure Sinon +sinon.assert.fail = function (msg) { + Assert.ok(false, msg); +}; +sinon.assert.pass = function (assertion) { + Assert.ok(assertion, "sinon assert"); +}; +sinon.config = { + injectIntoThis: true, + injectInto: null, + properties: ["spy", "stub", "mock", "clock", "sandbox"], + useFakeTimers: true, + useFakeServer: true +}; +/// +/// +/// +/// +/// +define("src/removeDynamic", ["require", "exports", "magic-string"], function (require, exports, magic_string_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + ; + function escape(str) { + return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); + } + function isSourceMapEnabled(options) { + if (options) { + return options.sourceMap !== false && options.sourcemap !== false; + } + return false; + } + // Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always + // exists in the build / test infrastructure + function padEnd(input, len, fill) { + var value = input || ""; + while (value.length < len) { + value += fill; + } + if (value.length > len) { + value = value.substring(0, len); + } + return value; + } + function isNullOrWhitespace(value) { + if (value) { + return value.replace(/\s/g, "").length < 1; + } + return true; + } + /** + * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to + * remove the boilerplate code require by typescript to define methods as prototype level while + * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" + * functions from the production code. + */ + function dynamicRemove(options) { + if (options === void 0) { options = {}; } + var token = (options || {}).tagname || "@DynamicProtoStub"; + var replaceValue = (options || {}).comment || "// Removed Stub for %function%."; + var tokenGroups = [4, 10, 13]; + var funcNameGroup = 6; + // Because of the test infrastructure (PhamtonJS) the RegEx can't use the "s" flag (gis vs gi) or named groups + var pattern = new RegExp("([\\t ]*\\/\\*\\*((?!\\*\\/)(.|\\r|\\n))*\\*\\/[\\s]*)*(\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*(\\r\\n|\\n\\r|\\r|\\n))*[\\t ]*([\\w]*\\.prototype(\\.|\\[\\\"|\\[\\')[\\w]*(\\\"\\]|\\'\\])?)[\\t ]*=[\\t ]*function[\\t ]*\\([^\\{]*\\{[^\\/\\}\\{]*(\\{[^\\}]*\\}[^\\/\\}\\{]*)*(\\/[\\*\\/][\\t ]*" + escape(token) + "[^\\*\\r\\n]*(\\*\\/)?(\\r\\n|\\n\\r|\\r|\\n))*[^\\}]*\\};([\\t ]*\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*)*", 'gi'); + function formatError(token, code, pos, id) { + var lines = code.split(/(?:\r\n|\n\r|\r|\n)/); + var lineNumber = 0; + var count = pos; + while (count > 0) { + lineNumber++; + count = code.lastIndexOf("\n", count - 1); + } + var column = 0; + var lineStart = code.lastIndexOf("\n", pos); + if (lineStart != -1) { + column = (pos - lineStart); + } + else { + column = pos + 1; + } + var message = "Invalid (Unremoved) token [" + token + "] found on line [" + lineNumber + "], column [" + column + "], position [" + pos + "] - " + (id || "") + "\n"; + var marker = padEnd("", token.length, "^"); + var line = lineNumber - 6; + if (line > 0) { + message += " ...\n"; + } + count = 0; + while (count < 10 && line < lines.length - 1) { + count++; + if (line >= 0) { + var number = padEnd("" + (line + 1), 4, " "); + message += number + ":" + lines[line] + "\n"; + if (line == lineNumber - 1) { + message += padEnd("", column + 4, " ") + marker + "\n"; + } + } + line++; + } + if (line < lines.length - 1) { + message += " ...\n"; + } + var match; + var matchCount = 0; + while ((match = pattern.exec(code))) { + var funcName = match[funcNameGroup]; + if (!isNullOrWhitespace(funcName)) { + if (matchCount == 0) { + message += "\nMatch checks\n"; + } + matchCount++; + if (match[0].length > 0) { + message += "Match " + matchCount + " tag Groups for " + (funcName || "") + "\n"; + message += "--=( Complete Matched Content )=--\n"; + message += match[0]; + message += "\n--------------------------------\n"; + for (var lp = 1; lp < match.length; lp++) { + if (match[lp]) { + message += "" + lp + ": " + (match[lp] || "").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); + if ((match[lp] || "").indexOf(token) != -1) { + message += " <- Contains tag"; + } + message += "\n"; + } + } + message += "\n"; + } + } + } + return message; + } + function replaceToken(code, theString) { + var result = false; + var match; + while ((match = pattern.exec(code))) { + var funcName = match[funcNameGroup]; + if (!isNullOrWhitespace(funcName)) { + // Only remove matches that contain a tag and function + var hasToken = false; + for (var lp = 0; lp < tokenGroups.length; lp++) { + if ((match[tokenGroups[lp]] || "").indexOf(token) != -1) { + hasToken = true; + break; + } + } + if (hasToken) { + result = true; + var start_1 = match.index; + var newValue = replaceValue.replace("%function%", funcName); + theString.overwrite(start_1, start_1 + match[0].length, newValue); + } + } + } + return result; + } + function checkResult(result, id) { + if (result) { + var pos = result.indexOf(token); + if (pos != -1) { + throw new Error(formatError(token, result, pos, id)); + } + } + } + function doTransform(code, id) { + var theString = new magic_string_1.default(code); + if (!replaceToken(code, theString)) { + return null; + } + var result = { code: theString.toString() }; + if (isSourceMapEnabled(options)) { + result.map = theString.generateMap({ hires: true }); + } + return result; + } + function doTransformAndCheck(code, id) { + var result = doTransform(code, id); + if (result) { + // Do a final check of the string + checkResult(result.code, id); + } + else { + // Check that the raw input doesn't include the tag + checkResult(code, id); + } + return result; + } + return { + name: 'dynamicRemove', + renderChunk: function (code, chunk) { + return doTransformAndCheck(code, chunk.filename); + }, + transform: doTransformAndCheck + }; + } + exports.default = dynamicRemove; +}); +/// +define("test/DynamicProtoRollup.Tests", ["require", "exports", "src/removeDynamic"], function (require, exports, removeDynamic_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoRollupTests = void 0; + var DynamicProtoRollupTests = /** @class */ (function (_super) { + __extends(DynamicProtoRollupTests, _super); + function DynamicProtoRollupTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoRollupTests.prototype.testInitialize = function () { + }; + DynamicProtoRollupTests.prototype.visibleNewlines = function (value) { + if (value) { + return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n"); + } + return value; + }; + DynamicProtoRollupTests.prototype.convertNewlines = function (value, newline) { + if (value) { + return value.replace(/\n/g, newline); + } + return value; + }; + DynamicProtoRollupTests.prototype.testNoChange = function (options, input) { + var plugin = (0, removeDynamic_1.default)(options); + QUnit.assert.equal(plugin.name, "dynamicRemove"); + QUnit.assert.equal(plugin.renderChunk(input, { filename: "test.js" }), null); + QUnit.assert.equal(plugin.transform(input, "testId"), null); + }; + DynamicProtoRollupTests.prototype.doTest = function (options, input, expected) { + this.testExpected(options, input, expected); + this.testExpected(options, this.convertNewlines(input, "\r"), this.convertNewlines(expected, "\r")); + this.testExpected(options, this.convertNewlines(input, "\r\n"), this.convertNewlines(expected, "\r\n")); + this.testExpected(options, this.convertNewlines(input, "\n\r"), this.convertNewlines(expected, "\n\r")); + }; + DynamicProtoRollupTests.prototype.testExpected = function (options, input, expected) { + var plugin = (0, removeDynamic_1.default)(options); + QUnit.assert.equal(plugin.name, "dynamicRemove"); + var result = plugin.renderChunk(input, { filename: "test.js" }); + QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); + result = plugin.transform(input, "testId"); + QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); + }; + DynamicProtoRollupTests.prototype.testError = function (options, message, input, expected) { + var plugin = (0, removeDynamic_1.default)(options); + QUnit.assert.throws(function () { + plugin.renderChunk(input, { filename: "test.js" }); + }, new Error(expected), message); + QUnit.assert.throws(function () { + plugin.transform(input, "test.js"); + }, new Error(expected), message); + }; + DynamicProtoRollupTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "No matching values for removal", + test: function () { + _this.testNoChange(null, "Nothing removed"); + _this.testNoChange(null, "ClassName.prototype.anotherMethod = function () {\n};\n"); + _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n"); + _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n"); + _this.testNoChange(null, "// @Stub -- Type 1 comment\n" + + "function methodName() {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n"); + _this.testNoChange(null, "function methodName() {\n" + + " // @Stub -- Type 2 single line comment\n" + + "};\n"); + _this.testNoChange(null, "function methodName() {\n" + + " /* @Stub -- Type 2 multiline comment */\n" + + "};\n"); + _this.testNoChange(null, "function methodName() {\n" + + " /* @Stub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n"); + } + }); + this.testCase({ + name: "Basic tag patterns", + test: function () { + _this.doTest(null, "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + + " // @DynamicProtoStub -- Type 2 single line comment\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + } + }); + this.testCase({ + name: "Mixed tagtype combinations", + test: function () { + _this.doTest(null, + // Input, + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + + " }; // @DynamicProtoStub - Tag type 3\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + + " // @DynamicProtoStub - Tag type 2.1\n" + + " };\n" + + " TestClass.prototype.func5 = function () {\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + + " /* @DynamicProtoStub - Tag type 2.2 */\n" + + " };\n" + + " return TestClass;", + // Expected Value + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + "// Removed Stub for TestClass.prototype.func1.\n" + + "// Removed Stub for TestClass.prototype.func2.\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func4.\n" + + " TestClass.prototype.func5 = function () {\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func6.\n" + + " return TestClass;"); + _this.testExpected(null, + // Input, + " /**\r\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r\n" + + " * @param coreConfig - The core configuration.\r\n" + + " * @param core - The AppInsights core.\r\n" + + " * @param extensions - An array of all the plugins being used.\r\n" + + " */\r\n" + + " // @DynamicProtoStub \r\n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\r\n" + + " };\r\n" + + " /**\r" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r" + + " * @param coreConfig - The core configuration.\r" + + " * @param core - The AppInsights core.\r" + + " * @param extensions - An array of all the plugins being used.\r" + + " */\r" + + " // @DynamicProtoStub \r" + + " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\r" + + " };\r" + + " /**\n\r" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n\r" + + " * @param coreConfig - The core configuration.\n\r" + + " * @param core - The AppInsights core.\n\r" + + " * @param extensions - An array of all the plugins being used.\n\r" + + " */\n\r" + + " // @DynamicProtoStub \n\r" + + " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n\r" + + " };\n\r" + + "", + // Expected Value + "// Removed Stub for TestClass.prototype.func1.\r\n" + + "// Removed Stub for TestClass.prototype.func2.\r" + + "// Removed Stub for TestClass.prototype.func3.\n\r"); + } + }); + this.testCase({ + name: "Stubs with return values", + test: function () { + _this.doTest(null, + // Input, + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + + " return;\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + + " return;\n" + + " }; // @DynamicProtoStub - Tag type 3\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + + " // @DynamicProtoStub - Tag type 2.1\n" + + " return;\n" + + " };\n" + + " TestClass.prototype.func5 = function () {\n" + + " return;\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + + " /* @DynamicProtoStub - Tag type 2.2 */\n" + + " return;\n" + + " };\n" + + " return TestClass;", + // Expected Value + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + "// Removed Stub for TestClass.prototype.func1.\n" + + "// Removed Stub for TestClass.prototype.func2.\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func4.\n" + + " TestClass.prototype.func5 = function () {\n" + + " return;\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func6.\n" + + " return TestClass;"); + _this.doTest(null, + // Input, + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + "", + // Expected Value + "// Removed Stub for TestClass.prototype.func1.\n" + + "// Removed Stub for TestClass.prototype.func2.\n" + + "// Removed Stub for TestClass.prototype.func3.\n"); + } + }); + this.testCase({ + name: "Test reserved (ES3) function names", + test: function () { + _this.doTest(null, + // Input, + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype[\"catch2\"] = function (evt, itemCtx) {\n" + + " return;\n" + + " }; // @DynamicProtoStub - Tag type 3\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype[\"func3\"] = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + " return TestClass;", + // Expected Value + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + "// Removed Stub for TestClass.prototype[\"catch\"].\n" + + "// Removed Stub for TestClass.prototype[\"catch2\"].\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype[\"func3\"] = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + " return TestClass;"); + _this.doTest(null, + // Input, + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"delete\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"throw\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + "", + // Expected Value + "// Removed Stub for TestClass.prototype[\"catch\"].\n" + + "// Removed Stub for TestClass.prototype[\"delete\"].\n" + + "// Removed Stub for TestClass.prototype[\"throw\"].\n" + + "// Removed Stub for TestClass.prototype['if'].\n"); + } + }); + this.testCase({ + name: "Test unconverted tags from partial conversion", + test: function () { + _this.testError(null, "1 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + + "function methodName() {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + + "1 :// @DynamicProtoStub -- Type 1 comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "2 :function methodName() {\n" + + "3 : // This is a comment for a dynamic proto stub\n" + + "4 :};\n"); + _this.testError(null, "2 -- Type 2 single line comment", "function methodName() {\n" + + " // @DynamicProtoStub -- Type 2 single line comment\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n"); + _this.testError(null, "3 -- Type 2 multiline comment", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n"); + _this.testError(null, "4 -- Type 2 multiline comment (2)", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 : * Continuation of a multi-line comment/\n" + + "4 : */\n" + + "5 :};\n"); + _this.testError(null, "5 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + + "function methodName() {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + + "1 :// @DynamicProtoStub -- Type 1 comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "2 :function methodName() {\n" + + "3 : // This is a comment for a dynamic proto stub\n" + + "4 :};\n" + + "5 :// Removed Stub for ClassName.prototype.methodName.\n"); + _this.testError(null, "6 -- Type 2 single line comment", "function methodName() {\n" + + " // @DynamicProtoStub -- Type 2 single line comment\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n" + + "4 :// Removed Stub for ClassName.prototype.methodName.\n"); + _this.testError(null, "7 -- Type 2 multiline comment */", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n" + + "4 :// Removed Stub for ClassName.prototype.methodName.\n"); + _this.testError(null, "8 -- Type 2 multiline comment (2)", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 : * Continuation of a multi-line comment/\n" + + "4 : */\n" + + "5 :};\n" + + "6 :// Removed Stub for ClassName.prototype.methodName.\n"); + } + }); + this.testCase({ + name: "Test prefixed comment with typescript boilerplate for spread and default arguments", + test: function () { + _this.doTest(null, "/**\n" + + " * This method tells if given durations should be excluded from collection.\n" + + " */\n" + + "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + + " var durations = [];\n" + + " for (var _i = 0; _i < arguments.length; _i++) {\n" + + " durations[_i] = arguments[_i];\n" + + " }\n" + + " // @DynamicProtoStub\n" + + " return true;\n" + + "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); + _this.doTest(null, " /**\n" + + " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + + " * Fall back to xhr sender if beacon is not supported.\n" + + " * @param {boolean} [async=true]\n" + + " * @memberof Initialization\n" + + " */\n" + + "Initialization.prototype.onunloadFlush = function (async) {\n" + + " if (async === void 0) { async = true; }\n" + + " // @DynamicProtoStub\n" + + "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); + _this.doTest(null, "/**\n" + + " * This method tells if given durations should be excluded from collection.\n" + + " */\n" + + "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + + " var durations = [];\n" + + " for (var _i = 0; _i < arguments.length; _i++) {\n" + + " durations[_i] = arguments[_i];\n" + + " }\n" + + " /* @DynamicProtoStub\n" + + " */\n" + + " return true;\n" + + "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); + _this.doTest(null, " /**\n" + + " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + + " * Fall back to xhr sender if beacon is not supported.\n" + + " * @param {boolean} [async=true]\n" + + " * @memberof Initialization\n" + + " */\n" + + "Initialization.prototype.onunloadFlush = function (async) {\n" + + " if (async === void 0) { async = true; }\n" + + " /* @DynamicProtoStub\n" + + " */\n" + + "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); + } + }); + }; + return DynamicProtoRollupTests; + }(TestClass)); + exports.DynamicProtoRollupTests = DynamicProtoRollupTests; +}); +define("test/Selenium/DynamicProtoRollupTests", ["require", "exports", "test/DynamicProtoRollup.Tests"], function (require, exports, DynamicProtoRollup_Tests_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.runTests = void 0; + function runTests() { + new DynamicProtoRollup_Tests_1.DynamicProtoRollupTests().registerTests(); + } + exports.runTests = runTests; +}); +//# sourceMappingURL=dynamicprotorolluptests.js.map \ No newline at end of file diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js.map b/rollup/test/Selenium/dynamicprotorolluptests.js.map new file mode 100644 index 0000000..6d144f9 --- /dev/null +++ b/rollup/test/Selenium/dynamicprotorolluptests.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicprotorolluptests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/removeDynamic.ts","../DynamicProtoRollup.Tests.ts","DynamicProtoRollupTests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA+C;AAE/C;;;;GAIG;AACH;IAAA;IA2IA,CAAC;IA1IE;;;;;;;;;;;OAWG;IACY,gBAAS,GAAvB,UAAwB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAChE,OAAO,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,YAAK,GAAnB,UAAoB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAC5D,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,mBAAY,GAA1B,UAA2B,QAAa,EAAE,MAAW,EAAE,OAAgB;QACnE,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,eAAQ,GAAtB,UAAuB,QAAa,EAAE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CAAC;aACR,CAAC,CAAC;QACP,CAAC;QACL,8BAAC;IAAD,CAAC,AAppBD,CAA6C,SAAS,GAopBrD;IAppBY,0DAAuB;;;;;;ICFpC,SAAgB,QAAQ;QACpB,IAAI,kDAAuB,EAAE,CAAC,aAAa,EAAE,CAAC;IAClD,CAAC;IAFD,4BAEC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","import MagicString from 'magic-string';\n\nexport interface IDynamicProtoRollupOptions {\n tagname?: string,\n comment?:string,\n sourcemap?: boolean\n};\n\nfunction escape(str:string) {\n return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\n\nfunction isSourceMapEnabled(options:any) {\n if (options) {\n return options.sourceMap !== false && options.sourcemap !== false;\n }\n\n return false;\n}\n\n// Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always\n// exists in the build / test infrastructure\nfunction padEnd(input:string, len:number, fill:string) {\n let value = input||\"\";\n while (value.length < len) {\n value += fill;\n }\n\n if (value.length > len) {\n value = value.substring(0, len);\n }\n\n return value;\n}\n\nfunction isNullOrWhitespace(value:string) {\n if (value) {\n return value.replace(/\\s/g, \"\").length < 1;\n }\n\n return true;\n}\n\n/**\n * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to\n * remove the boilerplate code require by typescript to define methods as prototype level while\n * using @ms-dynamicProto project to support minification. This can also be used to remove \"debug\"\n * functions from the production code.\n */\nexport default function dynamicRemove(options:IDynamicProtoRollupOptions = {}) {\n var token = (options || {}).tagname || \"@DynamicProtoStub\";\n var replaceValue = (options || {}).comment || \"// Removed Stub for %function%.\";\n let tokenGroups:Array = [4, 10, 13];\n let funcNameGroup:number = 6;\n\n // Because of the test infrastructure (PhamtonJS) the RegEx can't use the \"s\" flag (gis vs gi) or named groups\n const pattern = new RegExp(\"([\\\\t ]*\\\\/\\\\*\\\\*((?!\\\\*\\\\/)(.|\\\\r|\\\\n))*\\\\*\\\\/[\\\\s]*)*(\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[\\\\t ]*([\\\\w]*\\\\.prototype(\\\\.|\\\\[\\\\\\\"|\\\\[\\\\')[\\\\w]*(\\\\\\\"\\\\]|\\\\'\\\\])?)[\\\\t ]*=[\\\\t ]*function[\\\\t ]*\\\\([^\\\\{]*\\\\{[^\\\\/\\\\}\\\\{]*(\\\\{[^\\\\}]*\\\\}[^\\\\/\\\\}\\\\{]*)*(\\\\/[\\\\*\\\\/][\\\\t ]*\" + escape(token) + \"[^\\\\*\\\\r\\\\n]*(\\\\*\\\\/)?(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[^\\\\}]*\\\\};([\\\\t ]*\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*)*\", 'gi');\n\n function formatError(token:string, code:string, pos:number, id:string) {\n let lines = code.split(/(?:\\r\\n|\\n\\r|\\r|\\n)/);\n let lineNumber = 0;\n let count = pos;\n while (count > 0) {\n lineNumber ++;\n count = code.lastIndexOf(\"\\n\", count - 1);\n }\n \n let column = 0;\n let lineStart = code.lastIndexOf(\"\\n\", pos);\n if (lineStart != -1) {\n column = (pos - lineStart);\n } else {\n column = pos + 1;\n }\n \n var message = \"Invalid (Unremoved) token [\" + token + \"] found on line [\" + lineNumber + \"], column [\" + column + \"], position [\" + pos + \"] - \" + (id||\"\") + \"\\n\";\n \n let marker = padEnd(\"\", token.length, \"^\");\n let line = lineNumber - 6;\n if (line > 0) {\n message += \" ...\\n\";\n }\n \n count = 0;\n while (count < 10 && line < lines.length-1) {\n count++;\n if (line >= 0) {\n let number = padEnd(\"\" + (line + 1), 4, \" \");\n message += number + \":\" + lines[line] + \"\\n\";\n if (line == lineNumber-1) {\n message += padEnd(\"\", column + 4, \" \") + marker + \"\\n\";\n }\n }\n \n line++;\n }\n \n if (line < lines.length-1) {\n message += \" ...\\n\";\n }\n \n let match;\n let matchCount = 0;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n if (matchCount == 0) {\n message += \"\\nMatch checks\\n\";\n }\n\n matchCount++;\n if (match[0].length > 0) {\n message += \"Match \" + matchCount + \" tag Groups for \" + (funcName||\"\") + \"\\n\";\n message += \"--=( Complete Matched Content )=--\\n\";\n message += match[0];\n message += \"\\n--------------------------------\\n\";\n for(let lp = 1; lp < match.length; lp++) {\n if (match[lp]) {\n message += \"\" + lp + \": \" + (match[lp] || \"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n if ((match[lp]||\"\").indexOf(token) != -1) {\n message += \" <- Contains tag\";\n }\n message += \"\\n\";\n }\n }\n message += \"\\n\";\n }\n }\n }\n \n return message;\n }\n\n function replaceToken(code:string, theString:MagicString) {\n let result = false;\n let match;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n // Only remove matches that contain a tag and function\n let hasToken = false;\n for(let lp = 0; lp < tokenGroups.length; lp++) {\n if ((match[tokenGroups[lp]]||\"\").indexOf(token) != -1) {\n hasToken = true;\n break;\n }\n }\n \n if (hasToken) {\n result = true;\n let start = match.index;\n let newValue = replaceValue.replace(\"%function%\", funcName);\n theString.overwrite(start, start + match[0].length, newValue);\n }\n }\n }\n\n return result;\n }\n\n function checkResult(result:string, id:string) {\n if (result) {\n let pos = result.indexOf(token);\n if (pos != -1) {\n throw new Error(formatError(token, result, pos, id));\n }\n }\n }\n\n function doTransform(code:string, id:string) {\n let theString = new MagicString(code);\n if (!replaceToken(code, theString)) {\n return null;\n }\n\n let result:any = { code: theString.toString() };\n if (isSourceMapEnabled(options)) {\n result.map = theString.generateMap({hires: true});\n }\n\n return result;\n }\n\n function doTransformAndCheck(code:string, id:string) {\n let result = doTransform(code, id);\n if (result) {\n // Do a final check of the string\n checkResult(result.code, id);\n } else {\n // Check that the raw input doesn't include the tag\n checkResult(code, id);\n }\n\n return result;\n }\n\n return {\n name: 'dynamicRemove',\n renderChunk(code:string, chunk:any) {\n return doTransformAndCheck(code, chunk.filename);\n },\n transform: doTransformAndCheck\n }\n}\n \n ","/// \n\nimport dynamicRemove from '../src/removeDynamic';\n\nexport class DynamicProtoRollupTests extends TestClass {\n\n public testInitialize() {\n }\n\n private visibleNewlines(value) {\n if (value) {\n return value.replace(/\\r/g, \"\\\\r\").replace(/\\n/g, \"\\\\n\");\n }\n\n return value;\n }\n\n private convertNewlines(value, newline) {\n if (value) {\n return value.replace(/\\n/g, newline);\n }\n\n return value;\n }\n\n private testNoChange(options:any, input:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n QUnit.assert.equal(plugin.renderChunk(input, { filename: \"test.js\" }), null);\n QUnit.assert.equal(plugin.transform(input, \"testId\"), null);\n }\n\n private doTest(options:any, input:string, expected:string) {\n this.testExpected(options, input, expected);\n this.testExpected(options, this.convertNewlines(input, \"\\r\"), this.convertNewlines(expected, \"\\r\"));\n this.testExpected(options, this.convertNewlines(input, \"\\r\\n\"), this.convertNewlines(expected, \"\\r\\n\"));\n this.testExpected(options, this.convertNewlines(input, \"\\n\\r\"), this.convertNewlines(expected, \"\\n\\r\"));\n }\n\n private testExpected(options:any, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n let result = plugin.renderChunk(input, { filename: \"test.js\" });\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n\n result = plugin.transform(input, \"testId\");\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n }\n\n private testError(options:any, message:string, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.throws(() => {\n plugin.renderChunk(input, { filename: \"test.js\" });\n }, new Error(expected), message);\n\n QUnit.assert.throws(() => {\n plugin.transform(input, \"test.js\");\n }, new Error(expected), message);\n }\n\n public registerTests() {\n this.testCase({\n name: \"No matching values for removal\",\n test: () => {\n this.testNoChange(null, \"Nothing removed\");\n\n this.testNoChange(null, \"ClassName.prototype.anotherMethod = function () {\\n};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"// @Stub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" // @Stub -- Type 2 single line comment\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment */\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\");\n }\n });\n\n this.testCase({\n name: \"Basic tag patterns\",\n test: () => {\n this.doTest(null, \n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n this.testCase({\n name: \"Mixed tagtype combinations\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.testExpected(null, \n // Input, \n \" /**\\r\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\\n\" + \n \" * @param coreConfig - The core configuration.\\r\\n\" + \n \" * @param core - The AppInsights core.\\r\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\r\\n\" + \n \" */\\r\\n\" + \n \" // @DynamicProtoStub \\r\\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\r\\n\" + \n \" };\\r\\n\" + \n \" /**\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\" + \n \" * @param coreConfig - The core configuration.\\r\" + \n \" * @param core - The AppInsights core.\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\r\" + \n \" */\\r\" + \n \" // @DynamicProtoStub \\r\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\r\" + \n \" };\\r\" + \n \" /**\\n\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\\r\" + \n \" * @param coreConfig - The core configuration.\\n\\r\" + \n \" * @param core - The AppInsights core.\\n\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\n\\r\" + \n \" */\\n\\r\" + \n \" // @DynamicProtoStub \\n\\r\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\\r\" + \n \" };\\n\\r\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\r\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\r\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\\r\"\n );\n }\n });\n\n this.testCase({\n name: \"Stubs with return values\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test reserved (ES3) function names\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"catch2\\\"] = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch2\\\"].\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" +\n \" return TestClass;\",\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"delete\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"throw\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype[\\\"delete\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"throw\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype['if'].\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test unconverted tags from partial conversion\",\n test: () => {\n this.testError(null, \n \"1 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\");\n \n this.testError(null, \n \"2 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"3 -- Type 2 multiline comment\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"4 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\");\n\n this.testError(null,\n \"5 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\" +\n \"5 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n\n \n this.testError(null,\n \"6 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"7 -- Type 2 multiline comment */\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"8 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\" +\n \"6 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n\n this.testCase({\n name: \"Test prefixed comment with typescript boilerplate for spread and default arguments\",\n test: () => {\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" // @DynamicProtoStub\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" // @DynamicProtoStub\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n }\n });\n }\n}\n","import { DynamicProtoRollupTests } from '../DynamicProtoRollup.Tests';\n\nexport function runTests() {\n new DynamicProtoRollupTests().registerTests();\n}\n"]} \ No newline at end of file From 4af5bb7c211c148ec49cdba618858ab3e3ac0db4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 23:23:41 +0000 Subject: [PATCH 06/22] Revert version number back to 2.0.3 Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e553380..70bab56 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/dynamicproto-js", "description": "Microsoft Dynamic Proto Utility", - "version": "2.0.4", + "version": "2.0.3", "keywords": [ "javascript", "dynamic prototype", From a3d8f27495e9fab8c9fe378be8f9c69dd36613ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 23:41:48 +0000 Subject: [PATCH 07/22] Remove test files from PR Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/test/Selenium/dynamicprototests.d.ts | 301 -- lib/test/Selenium/dynamicprototests.js | 3775 ----------------- lib/test/Selenium/dynamicprototests.js.map | 1 - .../Selenium/dynamicprotorolluptests.d.ts | 214 - .../test/Selenium/dynamicprotorolluptests.js | 1107 ----- .../Selenium/dynamicprotorolluptests.js.map | 1 - 6 files changed, 5399 deletions(-) delete mode 100644 lib/test/Selenium/dynamicprototests.d.ts delete mode 100644 lib/test/Selenium/dynamicprototests.js delete mode 100644 lib/test/Selenium/dynamicprototests.js.map delete mode 100644 rollup/test/Selenium/dynamicprotorolluptests.d.ts delete mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js delete mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js.map diff --git a/lib/test/Selenium/dynamicprototests.d.ts b/lib/test/Selenium/dynamicprototests.d.ts deleted file mode 100644 index 5b2eebd..0000000 --- a/lib/test/Selenium/dynamicprototests.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -/// -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -declare class Assert { - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static deepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static equal(expected: any, actual: any, message?: string): any; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static notDeepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notEqual(expected: any, actual: any, message?: string): any; - static notPropEqual(expected: any, actual: any, message?: string): any; - static propEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notStrictEqual(expected: any, actual: any, message?: string): any; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - static ok(state: any, message?: string): any; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static strictEqual(expected: any, actual: any, message?: string): any; - /** - * Assertion to test if a callback throws an exception when run. - * - * When testing code that is expected to throw an exception based on a specific set of - * circumstances, use throws() to catch the error object for testing and comparison. - * - * @param block Function to execute - * @param expected Error Object to compare - * @param message A short description of the assertion - */ - static throws(block: () => any, expected: any, message?: string): any; - /** - * @param block Function to execute - * @param message A short description of the assertion - */ - static throws(block: () => any, message?: string): any; -} -/** Defines a test case */ -declare class TestCase { - /** Name to use for the test case */ - name: string; - /** Test case method */ - test: () => void; -} -/** Defines a test case */ -interface TestCaseAsync { - /** Name to use for the test case */ - name: string; - /** time to wait after pre before invoking post and calling start() */ - stepDelay: number; - /** async steps */ - steps: Array<() => void>; -} -declare class TestClass { - constructor(name?: string); - static isPollingStepFlag: string; - /** The instance of the currently running suite. */ - static currentTestClass: TestClass; - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - useFakeTimers: boolean; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - useFakeServer: boolean; - /** Method called before the start of each test method */ - testInitialize(): void; - /** Method called after each test method has completed */ - testCleanup(): void; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - registerTests(): void; - /** Register an async Javascript unit testcase. */ - testCaseAsync(testInfo: TestCaseAsync): void; - /** Register a Javascript unit testcase. */ - testCase(testInfo: TestCase): void; - /** Called when the test is starting. */ - private _testStarting; - /** Called when the test is completed. */ - private _testCompleted; - /**** Sinon methods and properties ***/ - clock: SinonFakeTimers; - server: SinonFakeServer; - sandbox: SinonSandbox; - /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ - spy(): SinonSpy; - /** Spies on the provided function */ - spy(funcToWrap: Function): SinonSpy; - /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ - spy(object: any, methodName: string, func?: Function): SinonSpy; - /** Creates an anonymous stub function. */ - stub(): SinonStub; - /** Stubs all the object's methods. */ - stub(object: any): SinonStub; - /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ - stub(object: any, methodName: string, func?: Function): SinonStub; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - mock(object: any): SinonMock; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; - protected setUserAgent(userAgent: string): void; -} -declare module "src/DynamicProto" { - /** - * Interface to define additional configuration options to control how the dynamic prototype functions operate. - */ - export interface IDynamicProtoOpts { - /** - * Should the dynamic prototype attempt to set an instance function for instances that do not already have an - * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function. - */ - setInstFuncs: boolean; - /** - * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions - * and bypass the prototype lookups. Defaults to true. - */ - useBaseInst?: boolean; - } - /** - * The delegate signature for the function used as the callback for dynamicProto() - * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even - * though it is only a proxy that only contains the functions - * @param theTarget This is the real "this" of the current target object - * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the "this" instance before - * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the "super" keyword. - */ - export type DynamicProtoDelegate = (theTarget: DPType, baseFuncProxy?: DPType) => void; - /** - * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- - * - Saves references to all defined base class functions - * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. - * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. - * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is - * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of - * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" - * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions - * defined in the constructor or some other function (rather than declared as complete typescript functions). - * ### Usage - * ```typescript - * import dynamicProto from "@microsoft/dynamicproto-js"; - * class ExampleClass extends BaseClass { - * constructor() { - * dynamicProto(ExampleClass, this, (_self, base) => { - * // This will define a function that will be converted to a prototype function - * _self.newFunc = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * ... - * } - * } - * // This will define a function that will be converted to a prototype function - * _self.myFunction = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * // Call the base version of the function that we are overriding - * base.myFunction(); - * } - * ... - * } - * _self.initialize = () => { - * ... - * } - * // Warnings: While the following will work as _self is simply a reference to - * // this, if anyone overrides myFunction() the overridden will be called first - * // as the normal JavaScript method resolution will occur and the defined - * // _self.initialize() function is actually gets removed from the instance and - * // a proxy prototype version is created to reference the created method. - * _self.initialize(); - * }); - * } - * } - * ``` - * @typeparam DPType This is the generic type of the class, used to keep intellisense valid - * @typeparam DPCls The type that contains the prototype of the current class - * @param theClass - This is the current class instance which contains the prototype for the current class - * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. - * @param delegateFunc - The callback function (closure) that will create the dynamic function - * @param options - Additional options to configure how the dynamic prototype operates - */ - export default function dynamicProto(theClass: DPCls, target: DPType, delegateFunc: DynamicProtoDelegate, options?: IDynamicProtoOpts): void; -} -declare module "test/DynamicProto.Tests" { - export class DynamicProtoDefaultTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/DynamicProtoMultipleCall.Tests" { - export class DynamicProtoMultipleCallTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/DynamicProtoNoInst.Tests" { - export class DynamicProtoNoInstTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/DynamicProtoMultipleNoInst.Tests" { - export class DynamicProtoMultipleNoInstTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/SecurityCheck.Tests" { - export class SecurityCheckTests extends TestClass { - testInitialize(): void; - registerTests(): void; - } -} -declare module "test/Selenium/DynamicProtoTests" { - export function runTests(): void; -} diff --git a/lib/test/Selenium/dynamicprototests.js b/lib/test/Selenium/dynamicprototests.js deleted file mode 100644 index 4ad2564..0000000 --- a/lib/test/Selenium/dynamicprototests.js +++ /dev/null @@ -1,3775 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -var Assert = /** @class */ (function () { - function Assert() { - } - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.deepEqual = function (expected, actual, message) { - return deepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.equal = function (expected, actual, message) { - return equal(actual, expected, message); - }; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.notDeepEqual = function (expected, actual, message) { - return notDeepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notEqual = function (expected, actual, message) { - return notEqual(actual, expected, message); - }; - Assert.notPropEqual = function (expected, actual, message) { - return notPropEqual(actual, expected, message); - }; - Assert.propEqual = function (expected, actual, message) { - return propEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notStrictEqual = function (expected, actual, message) { - return notStrictEqual(actual, expected, message); - }; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - Assert.ok = function (state, message) { - return ok(state, message); - }; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.strictEqual = function (expected, actual, message) { - return strictEqual(actual, expected, message); - }; - Assert.throws = function (block, expected, message) { - return throws(block, expected, message); - }; - return Assert; -}()); -/** Defines a test case */ -var TestCase = /** @class */ (function () { - function TestCase() { - } - return TestCase; -}()); -/// -/// -/// -/// -var TestClass = /** @class */ (function () { - function TestClass(name) { - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - this.useFakeTimers = true; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - this.useFakeServer = true; - QUnit.module(name); - } - /** Method called before the start of each test method */ - TestClass.prototype.testInitialize = function () { - }; - /** Method called after each test method has completed */ - TestClass.prototype.testCleanup = function () { - }; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - TestClass.prototype.registerTests = function () { - }; - /** Register an async Javascript unit testcase. */ - TestClass.prototype.testCaseAsync = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (isNaN(testInfo.stepDelay)) { - throw new Error("Must specify 'stepDelay' period between pre and post"); - } - if (!testInfo.steps) { - throw new Error("Must specify 'steps' to take asynchronously"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function (assert) { - var done = assert.async(); - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - var steps_1 = testInfo.steps; - var trigger_1 = function () { - if (steps_1.length) { - var step = steps_1.shift(); - // The callback which activates the next test step. - var nextTestStepTrigger = function () { - setTimeout(function () { - trigger_1(); - }, testInfo.stepDelay); - }; - // There 2 types of test steps - simple and polling. - // Upon completion of the simple test step the next test step will be called. - // In case of polling test step the next test step is passed to the polling test step, and - // it is responsibility of the polling test step to call the next test step. - try { - if (step[TestClass.isPollingStepFlag]) { - step.call(_this, nextTestStepTrigger); - } - else { - step.call(_this); - nextTestStepTrigger.call(_this); - } - } - catch (e) { - _this._testCompleted(); - Assert.ok(false, e.toString()); - // done is QUnit callback indicating the end of the test - done(); - return; - } - } - else { - _this._testCompleted(); - // done is QUnit callback indicating the end of the test - done(); - } - }; - trigger_1(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - // done is QUnit callback indicating the end of the test - done(); - } - }; - // Register the test with QUnit - QUnit.test(testInfo.name, testMethod); - }; - /** Register a Javascript unit testcase. */ - TestClass.prototype.testCase = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (!testInfo.test) { - throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function () { - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - testInfo.test.call(_this); - _this._testCompleted(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - } - }; - // Register the test with QUnit - test(testInfo.name, testMethod); - }; - /** Called when the test is starting. */ - TestClass.prototype._testStarting = function () { - // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. - var config = sinon.getConfig(sinon.config); - config.useFakeTimers = this.useFakeTimers; - config.useFakeServer = this.useFakeServer; - config.injectInto = config.injectIntoThis && this || config.injectInto; - this.sandbox = sinon.sandbox.create(config); - this.server = this.sandbox.server; - // Allow the derived class to perform test initialization. - this.testInitialize(); - }; - /** Called when the test is completed. */ - TestClass.prototype._testCompleted = function (failed) { - if (failed) { - // Just cleanup the sandbox since the test has already failed. - this.sandbox.restore(); - } - else { - // Verify the sandbox and restore. - this.sandbox.verifyAndRestore(); - } - this.testCleanup(); - // Clear the instance of the currently running suite. - TestClass.currentTestClass = null; - }; - TestClass.prototype.spy = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - TestClass.prototype.stub = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - TestClass.prototype.mock = function (object) { return null; }; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { - if (errorCode === undefined) { - errorCode = 200; - } - request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); - }; - TestClass.prototype.setUserAgent = function (userAgent) { - Object.defineProperty(window.navigator, 'userAgent', { - configurable: true, - get: function () { - return userAgent; - } - }); - }; - TestClass.isPollingStepFlag = "isPollingStep"; - return TestClass; -}()); -// Configure Sinon -sinon.assert.fail = function (msg) { - Assert.ok(false, msg); -}; -sinon.assert.pass = function (assertion) { - Assert.ok(assertion, "sinon assert"); -}; -sinon.config = { - injectIntoThis: true, - injectInto: null, - properties: ["spy", "stub", "mock", "clock", "sandbox"], - useFakeTimers: true, - useFakeServer: true -}; -/// -/// -/// -/// -/// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -define("src/DynamicProto", ["require", "exports", "@nevware21/ts-utils"], function (require, exports, ts_utils_1) { - "use strict"; - var _a; - Object.defineProperty(exports, "__esModule", { value: true }); - ; - var UNDEFINED = "undefined"; - /** - * Helper to check if we're running in a server-side rendering environment - * like Node.js or Cloudflare Workers - * @ignore - */ - function _isServerSideRender() { - var gbl = (0, ts_utils_1.getGlobal)(); - // Check for common server-side environments - // 1. Missing window or document (Node.js, some SSR frameworks) - // 2. Cloudflare Worker specific environment - return (typeof gbl.window === UNDEFINED || - typeof gbl.document === UNDEFINED || - (typeof gbl.navigator !== UNDEFINED && - typeof gbl.navigator.userAgent !== UNDEFINED && - gbl.navigator.userAgent.indexOf('Cloudflare-Workers') >= 0)); - } - /** - * Constant string defined to support minimization - * @ignore - */ - var Constructor = 'constructor'; - /** - * Constant string defined to support minimization - * @ignore - */ - var Prototype = 'prototype'; - /** - * Constant string defined to support minimization - * @ignore - */ - var strFunction = 'function'; - /** - * Used to define the name of the instance function lookup table - * @ignore - */ - var DynInstFuncTable = '_dynInstFuncs'; - /** - * Name used to tag the dynamic prototype function - * @ignore - */ - var DynProxyTag = '_isDynProxy'; - /** - * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table - * @ignore - */ - var DynClassName = '_dynClass'; - /** - * Prefix added to the classname to avoid any name clashes with other instance level properties - * @ignore - */ - var DynClassNamePrefix = '_dynCls$'; - /** - * A tag which is used to check if we have already to attempted to set the instance function if one is not present - * @ignore - */ - var DynInstChkTag = '_dynInstChk'; - /** - * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same - * tag name as the function level but a different const name for readability only. - */ - var DynAllowInstChkTag = DynInstChkTag; - /** - * The global (imported) instances where the global performance options are stored - */ - var DynProtoDefaultOptions = '_dfOpts'; - /** - * Value used as the name of a class when it cannot be determined - * @ignore - */ - var UnknownValue = '_unknown_'; - /** - * Constant string defined to support minimization - * @ignore - */ - var str__Proto = "__proto__"; - /** - * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist - */ - var DynProtoBaseProto = "_dyn" + str__Proto; - /** - * Runtime Global holder for dynamicProto settings - */ - var DynProtoGlobalSettings = "__dynProto$Gbl"; - /** - * Track the current prototype for IE8 as you can't look back to get the prototype - */ - var DynProtoCurrent = "_dynInstProto"; - /** - * Constant string defined to support minimization - * @ignore - */ - var strUseBaseInst = 'useBaseInst'; - /** - * Constant string defined to support minimization - * @ignore - */ - var strSetInstFuncs = 'setInstFuncs'; - var Obj = Object; - /** - * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) - * @ignore - */ - var _objGetPrototypeOf = Obj["getPrototypeOf"]; - /** - * Pre-lookup to check for the existence of this function - */ - var _objGetOwnProps = Obj["getOwnPropertyNames"]; - // Since 1.1.7 moving these to the runtime global to work around mixed version and module issues - // See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details - var _gbl = (0, ts_utils_1.getGlobal)(); - var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { - o: (_a = {}, - _a[strSetInstFuncs] = true, - _a[strUseBaseInst] = true, - _a), - n: 1000 // Start new global index @ 1000 so we "fix" some cases when mixed with 1.1.6 or earlier - }); - /** - * Helper used to check whether the target is an Object prototype or Array prototype - * @ignore - */ - function _isObjectOrArrayPrototype(target) { - return target && (target === Obj[Prototype] || target === Array[Prototype]); - } - /** - * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype - * @ignore - */ - function _isObjectArrayOrFunctionPrototype(target) { - return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; - } - /** - * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. - * @ignore - */ - function _getObjProto(target) { - var newProto; - if (target) { - // This method doesn't exist in older browsers (e.g. IE8) - if (_objGetPrototypeOf) { - return _objGetPrototypeOf(target); - } - var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); - // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class - newProto = target[DynProtoBaseProto] || curProto; - if (!(0, ts_utils_1.objHasOwnProperty)(target, DynProtoBaseProto)) { - // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it - // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) - delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy - newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; - target[DynProtoCurrent] = curProto; - } - } - return newProto; - } - /** - * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 - * are not enumerable. - * @param target - */ - function _forEachProp(target, func) { - var props = []; - if (_objGetOwnProps) { - props = _objGetOwnProps(target); - } - else { - for (var name_1 in target) { - if (typeof name_1 === "string" && (0, ts_utils_1.objHasOwnProperty)(target, name_1)) { - props.push(name_1); - } - } - } - if (props && props.length > 0) { - for (var lp = 0; lp < props.length; lp++) { - func(props[lp]); - } - } - } - /** - * Helper function to check whether the provided function name is a potential candidate for dynamic - * callback and prototype generation. - * @param target The target object, may be a prototype or class object - * @param funcName The function name - * @param skipOwn Skips the check for own property - * @ignore - */ - function _isDynamicCandidate(target, funcName, skipOwn) { - return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || (0, ts_utils_1.objHasOwnProperty)(target, funcName)) && funcName !== str__Proto && funcName !== Prototype); - } - /** - * Helper to throw a TypeError exception - * @param message the message - * @ignore - */ - function _throwTypeError(message) { - (0, ts_utils_1.throwTypeError)("DynamicProto: " + message); - } - /** - * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does - * not return any inherited functions - * @param thisTarget The object to get the instance functions from - * @ignore - */ - function _getInstanceFuncs(thisTarget) { - // Get the base proto - var instFuncs = (0, ts_utils_1.objCreate)(null); - // Save any existing instance functions - _forEachProp(thisTarget, function (name) { - // Don't include any dynamic prototype instances - as we only want the real functions - if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { - // Create an instance callback for passing the base function to the caller - instFuncs[name] = thisTarget[name]; - } - }); - return instFuncs; - } - /** - * Returns whether the value is included in the array - * @param values The array of values - * @param value The value - */ - function _hasVisited(values, value) { - for (var lp = values.length - 1; lp >= 0; lp--) { - if (values[lp] === value) { - return true; - } - } - return false; - } - /** - * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" - * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references - * @param target The current instance - * @ignore - */ - function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { - function _instFuncProxy(target, funcHost, funcName) { - var theFunc = funcHost[funcName]; - if (theFunc[DynProxyTag] && useBaseInst) { - // grab and reuse the hosted looking function (if available) otherwise the original passed function - var instFuncTable = target[DynInstFuncTable] || {}; - if (instFuncTable[DynAllowInstChkTag] !== false) { - theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; - } - } - return function () { - // eslint-disable-next-line prefer-rest-params - return theFunc.apply(target, arguments); - }; - } - // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) - var baseFuncs = (0, ts_utils_1.objCreate)(null); - _forEachProp(instFuncs, function (name) { - // Create an instance callback for passing the base function to the caller - baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); - }); - // Get the base prototype functions - var baseProto = _getObjProto(classProto); - var visited = []; - // Don't include base object functions for Object, Array or Function - while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { - // look for prototype functions - _forEachProp(baseProto, function (name) { - // Don't include any dynamic prototype instances - as we only want the real functions - // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the - // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return - // the Object prototype methods while bypassing the check - if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { - // Create an instance callback for passing the base function to the caller - baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); - } - }); - // We need to find all possible functions that might be overloaded by walking the entire prototype chain - // This avoids the caller from needing to check whether it's direct base class implements the function or not - // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. - visited.push(baseProto); - baseProto = _getObjProto(baseProto); - } - return baseFuncs; - } - function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { - var instFunc = null; - // We need to check whether the class name is defined directly on this prototype otherwise - // it will walk the proto chain and return any parent proto classname. - if (target && (0, ts_utils_1.objHasOwnProperty)(proto, DynClassName)) { - var instFuncTable = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); - instFunc = (instFuncTable[proto[DynClassName]] || (0, ts_utils_1.objCreate)(null))[funcName]; - if (!instFunc) { - // Avoid stack overflow from recursive calling the same function - _throwTypeError("Missing [" + funcName + "] " + strFunction); - } - // We have the instance function, lets check it we can speed up further calls - // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) - if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { - // If the instance already has an instance function we can't replace it - var canAddInst = !(0, ts_utils_1.objHasOwnProperty)(target, funcName); - // Get current prototype - var objProto = _getObjProto(target); - var visited = []; - // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function - // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut - while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { - var protoFunc = objProto[funcName]; - if (protoFunc) { - canAddInst = (protoFunc === currentDynProtoProxy); - break; - } - // We need to find all possible initial functions to ensure that we don't bypass a valid override function - visited.push(objProto); - objProto = _getObjProto(objProto); - } - try { - if (canAddInst) { - // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version - // so it's safe to directly assign for any subsequent calls (for better performance) - target[funcName] = instFunc; - } - // Block further attempts to set the instance function for any - instFunc[DynInstChkTag] = 1; - } - catch (e) { - // Don't crash if the object is readonly or the runtime doesn't allow changing this - // And set a flag so we don't try again for any function - instFuncTable[DynAllowInstChkTag] = false; - } - } - } - return instFunc; - } - function _getProtoFunc(funcName, proto, currentDynProtoProxy) { - var protoFunc = proto[funcName]; - // Check that the prototype function is not a self reference -- try to avoid stack overflow! - if (protoFunc === currentDynProtoProxy) { - // It is so lookup the base prototype - protoFunc = _getObjProto(proto)[funcName]; - } - if (typeof protoFunc !== strFunction) { - _throwTypeError("[" + funcName + "] is not a " + strFunction); - } - return protoFunc; - } - /** - * Add the required dynamic prototype methods to the the class prototype - * @param proto - The class prototype - * @param className - The instance classname - * @param target - The target instance - * @param baseInstFuncs - The base instance functions - * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist - * @ignore - */ - function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { - function _createDynamicPrototype(proto, funcName) { - var dynProtoProxy = function () { - // Use the instance or prototype function - var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); - // eslint-disable-next-line prefer-rest-params - return instFunc.apply(this, arguments); - }; - // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing - // via which can dynamically replace the prototype function reference) - dynProtoProxy[DynProxyTag] = 1; - return dynProtoProxy; - } - if (!_isObjectOrArrayPrototype(proto)) { - var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); - if (!_isObjectOrArrayPrototype(instFuncTable)) { - var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || (0, ts_utils_1.objCreate)(null)); // fetch and assign if as it may not exist yet - // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable - if (instFuncTable[DynAllowInstChkTag] !== false) { - instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; - } - if (!_isObjectOrArrayPrototype(instFuncs_1)) { - _forEachProp(target, function (name) { - // Only add overridden functions - if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { - // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function - instFuncs_1[name] = target[name]; - delete target[name]; - // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one - if (!(0, ts_utils_1.objHasOwnProperty)(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { - proto[name] = _createDynamicPrototype(proto, name); - } - } - }); - } - } - } - } - /** - * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance - * @param classProto The class prototype instance - * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy - * @ignore - */ - function _checkPrototype(classProto, thisTarget) { - // This method doesn't existing in older browsers (e.g. IE8) - if (_objGetPrototypeOf) { - // As this is primarily a coding time check, don't bother checking if running in IE8 or lower - var visited = []; - var thisProto = _getObjProto(thisTarget); - while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { - if (thisProto === classProto) { - return true; - } - // This avoids the caller from needing to check whether it's direct base class implements the function or not - // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. - visited.push(thisProto); - thisProto = _getObjProto(thisProto); - } - return false; - } - // If objGetPrototypeOf doesn't exist then just assume everything is ok. - return true; - } - /** - * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. - * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. - * @param target - * @param unknownValue - * @ignore - */ - function _getObjName(target, unknownValue) { - if ((0, ts_utils_1.objHasOwnProperty)(target, Prototype)) { - // Look like a prototype - return target.name || unknownValue || UnknownValue; - } - return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; - } - /** - * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- - * - Saves references to all defined base class functions - * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. - * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. - * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is - * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of - * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" - * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions - * defined in the constructor or some other function (rather than declared as complete typescript functions). - * ### Usage - * ```typescript - * import dynamicProto from "@microsoft/dynamicproto-js"; - * class ExampleClass extends BaseClass { - * constructor() { - * dynamicProto(ExampleClass, this, (_self, base) => { - * // This will define a function that will be converted to a prototype function - * _self.newFunc = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * ... - * } - * } - * // This will define a function that will be converted to a prototype function - * _self.myFunction = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * // Call the base version of the function that we are overriding - * base.myFunction(); - * } - * ... - * } - * _self.initialize = () => { - * ... - * } - * // Warnings: While the following will work as _self is simply a reference to - * // this, if anyone overrides myFunction() the overridden will be called first - * // as the normal JavaScript method resolution will occur and the defined - * // _self.initialize() function is actually gets removed from the instance and - * // a proxy prototype version is created to reference the created method. - * _self.initialize(); - * }); - * } - * } - * ``` - * @typeparam DPType This is the generic type of the class, used to keep intellisense valid - * @typeparam DPCls The type that contains the prototype of the current class - * @param theClass - This is the current class instance which contains the prototype for the current class - * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. - * @param delegateFunc - The callback function (closure) that will create the dynamic function - * @param options - Additional options to configure how the dynamic prototype operates - */ - function dynamicProto(theClass, target, delegateFunc, options) { - // Make sure that the passed theClass argument looks correct - if (!(0, ts_utils_1.objHasOwnProperty)(theClass, Prototype)) { - _throwTypeError("theClass is an invalid class definition."); - } - // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) - var classProto = theClass[Prototype]; - if (!_checkPrototype(classProto, target)) { - _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); - } - var className = null; - if ((0, ts_utils_1.objHasOwnProperty)(classProto, DynClassName)) { - // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) - className = classProto[DynClassName]; - } - else { - // As not all browser support name on the prototype creating a unique dynamic one if we have not already - // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance - // function table lookup. - className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; - _gblInst.n++; - classProto[DynClassName] = className; - } - var perfOptions = dynamicProto[DynProtoDefaultOptions]; - var useBaseInst = !!perfOptions[strUseBaseInst]; - if (useBaseInst && options && options[strUseBaseInst] !== undefined) { - useBaseInst = !!options[strUseBaseInst]; - } - // Get the current instance functions - var instFuncs = _getInstanceFuncs(target); - // Get all of the functions for any base instance (before they are potentially overridden) - var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); - // Execute the delegate passing in both the current target "this" and "base" function references - // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support - delegateFunc(target, baseFuncs); - // Don't allow setting instance functions for older IE instances or in SSR environments - var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isServerSideRender(); - if (setInstanceFunc && options) { - setInstanceFunc = !!options[strSetInstFuncs]; - } - // Populate the Prototype for any overridden instance functions - _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); - } - exports.default = dynamicProto; - /** - * Exposes the default global options to allow global configuration, if the global values are disabled these will override - * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose - * their internal usage of dynamic proto. - */ - dynamicProto[DynProtoDefaultOptions] = _gblInst.o; -}); -/// -define("test/DynamicProto.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoDefaultTests = void 0; - var InheritTest1 = /** @class */ (function () { - function InheritTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritTest1; - }()); - var InheritTest2 = /** @class */ (function (_super) { - __extends(InheritTest2, _super); - function InheritTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritTest2; - }(InheritTest1)); - var InheritTest3 = /** @class */ (function (_super) { - __extends(InheritTest3, _super); - function InheritTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritTest3; - }(InheritTest2)); - var DynInheritTest1 = /** @class */ (function () { - function DynInheritTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_1.default)(DynInheritTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }); - } - return DynInheritTest1; - }()); - var InheritTest4 = /** @class */ (function (_super) { - __extends(InheritTest4, _super); - function InheritTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritTest4; - }(DynInheritTest1)); - var InheritTest5 = /** @class */ (function (_super) { - __extends(InheritTest5, _super); - function InheritTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritTest5; - }(InheritTest4)); - var DynInheritTest2 = /** @class */ (function (_super) { - __extends(DynInheritTest2, _super); - function DynInheritTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_1.default)(DynInheritTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }); - return _this; - } - return DynInheritTest2; - }(InheritTest1)); - var DynInheritTest3 = /** @class */ (function (_super) { - __extends(DynInheritTest3, _super); - function DynInheritTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_1.default)(DynInheritTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }); - return _this; - } - return DynInheritTest3; - }(DynInheritTest2)); - var InheritTest6 = /** @class */ (function (_super) { - __extends(InheritTest6, _super); - function InheritTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritTest6; - }(DynInheritTest2)); - var DynInheritTest4 = /** @class */ (function (_super) { - __extends(DynInheritTest4, _super); - function DynInheritTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_1.default)(DynInheritTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }); - return _this; - } - return DynInheritTest4; - }(InheritTest6)); - var DynInheritTest5 = /** @class */ (function (_super) { - __extends(DynInheritTest5, _super); - function DynInheritTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_1.default)(DynInheritTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }); - return _this; - } - return DynInheritTest5; - }(DynInheritTest1)); - var DynInheritTest6 = /** @class */ (function (_super) { - __extends(DynInheritTest6, _super); - function DynInheritTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_1.default)(DynInheritTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }); - return _this; - } - return DynInheritTest6; - }(DynInheritTest5)); - var InstInherit1 = /** @class */ (function () { - function InstInherit1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInherit1; - }()); - var InstInherit2 = /** @class */ (function (_super) { - __extends(InstInherit2, _super); - function InstInherit2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInherit2; - }(InheritTest2)); - var InheritTest7 = /** @class */ (function (_super) { - __extends(InheritTest7, _super); - function InheritTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritTest7; - }(InstInherit1)); - var DynInheritTest7 = /** @class */ (function (_super) { - __extends(DynInheritTest7, _super); - function DynInheritTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_1.default)(DynInheritTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritTest7; - }(InstInherit1)); - var InstInherit3 = /** @class */ (function (_super) { - __extends(InstInherit3, _super); - function InstInherit3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInherit3; - }(DynInheritTest7)); - var DynInheritTest8 = /** @class */ (function (_super) { - __extends(DynInheritTest8, _super); - function DynInheritTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_1.default)(DynInheritTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }); - return _this; - } - return DynInheritTest8; - }(InstInherit3)); - var BadInstInherit1 = /** @class */ (function (_super) { - __extends(BadInstInherit1, _super); - function BadInstInherit1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInherit1; - }(InstInherit1)); - var DynInheritTest9 = /** @class */ (function (_super) { - __extends(DynInheritTest9, _super); - function DynInheritTest9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_1.default)(DynInheritTest9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }); - return _this; - } - return DynInheritTest9; - }(BadInstInherit1)); - var GoodInstInherit1 = /** @class */ (function (_super) { - __extends(GoodInstInherit1, _super); - function GoodInstInherit1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInherit1; - }(InstInherit1)); - var DynInheritTest10 = /** @class */ (function (_super) { - __extends(DynInheritTest10, _super); - function DynInheritTest10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_1.default)(DynInheritTest10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }); - return _this; - } - return DynInheritTest10; - }(GoodInstInherit1)); - var GoodInstInherit2 = /** @class */ (function (_super) { - __extends(GoodInstInherit2, _super); - function GoodInstInherit2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInherit2; - }(DynInheritTest10)); - var DynamicProtoDefaultTests = /** @class */ (function (_super) { - __extends(DynamicProtoDefaultTests, _super); - function DynamicProtoDefaultTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoDefaultTests.prototype.testInitialize = function () { - }; - DynamicProtoDefaultTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoDefaultTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoDefaultTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "Default: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritTest1(), [ - "InheritTest1()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInherit1(), [ - "InstInherit1()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInherit2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInherit3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInherit1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTest9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInherit1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTest10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInherit2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - ]); - } - }); - }; - return DynamicProtoDefaultTests; - }(TestClass)); - exports.DynamicProtoDefaultTests = DynamicProtoDefaultTests; -}); -/// -define("test/DynamicProtoMultipleCall.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_2) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoMultipleCallTests = void 0; - var InheritMultipleCallTest1 = /** @class */ (function () { - function InheritMultipleCallTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritMultipleCallTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritMultipleCallTest1; - }()); - var InheritMultipleCallTest2 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest2, _super); - function InheritMultipleCallTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritMultipleCallTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritMultipleCallTest2; - }(InheritMultipleCallTest1)); - var InheritMultipleCallTest3 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest3, _super); - function InheritMultipleCallTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritMultipleCallTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritMultipleCallTest3; - }(InheritMultipleCallTest2)); - var DynInheritMultipleCallTest1 = /** @class */ (function () { - function DynInheritMultipleCallTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }); - } - return DynInheritMultipleCallTest1; - }()); - var InheritMultipleCallTest4 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest4, _super); - function InheritMultipleCallTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritMultipleCallTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritMultipleCallTest4; - }(DynInheritMultipleCallTest1)); - var InheritMultipleCallTest5 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest5, _super); - function InheritMultipleCallTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritMultipleCallTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritMultipleCallTest5; - }(InheritMultipleCallTest4)); - var DynInheritMultipleCallTest2 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest2, _super); - function DynInheritMultipleCallTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest2; - }(InheritMultipleCallTest1)); - var DynInheritMultipleCallTest3 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest3, _super); - function DynInheritMultipleCallTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest3; - }(DynInheritMultipleCallTest2)); - var InheritMultipleCallTest6 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest6, _super); - function InheritMultipleCallTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritMultipleCallTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritMultipleCallTest6; - }(DynInheritMultipleCallTest2)); - var DynInheritMultipleCallTest4 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest4, _super); - function DynInheritMultipleCallTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest4; - }(InheritMultipleCallTest6)); - var DynInheritMultipleCallTest5 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest5, _super); - function DynInheritMultipleCallTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest5; - }(DynInheritMultipleCallTest1)); - var DynInheritMultipleCallTest6 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest6, _super); - function DynInheritMultipleCallTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest6; - }(DynInheritMultipleCallTest5)); - var InstInheritMultipleCall1 = /** @class */ (function () { - function InstInheritMultipleCall1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInheritMultipleCall1; - }()); - var InstInheritMultipleCall2 = /** @class */ (function (_super) { - __extends(InstInheritMultipleCall2, _super); - function InstInheritMultipleCall2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInheritMultipleCall2; - }(InheritMultipleCallTest2)); - var InheritMultipleCallTest7 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest7, _super); - function InheritMultipleCallTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritMultipleCallTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritMultipleCallTest7; - }(InstInheritMultipleCall1)); - var DynInheritMultipleCallTest7 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest7, _super); - function DynInheritMultipleCallTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest7; - }(InstInheritMultipleCall1)); - var InstInheritMultipleCall3 = /** @class */ (function (_super) { - __extends(InstInheritMultipleCall3, _super); - function InstInheritMultipleCall3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInheritMultipleCall3; - }(DynInheritMultipleCallTest7)); - var DynInheritMultipleCallTest8 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest8, _super); - function DynInheritMultipleCallTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest8; - }(InstInheritMultipleCall3)); - var BadInstInheritMultipleCall1 = /** @class */ (function (_super) { - __extends(BadInstInheritMultipleCall1, _super); - function BadInstInheritMultipleCall1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInheritMultipleCall1; - }(InstInheritMultipleCall1)); - var DynInheritTestMultipleCall9 = /** @class */ (function (_super) { - __extends(DynInheritTestMultipleCall9, _super); - function DynInheritTestMultipleCall9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_2.default)(DynInheritTestMultipleCall9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }); - return _this; - } - return DynInheritTestMultipleCall9; - }(BadInstInheritMultipleCall1)); - var GoodInstInheritMultipleCall1 = /** @class */ (function (_super) { - __extends(GoodInstInheritMultipleCall1, _super); - function GoodInstInheritMultipleCall1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInheritMultipleCall1; - }(InstInheritMultipleCall1)); - var DynInheritTestMultipleCall10 = /** @class */ (function (_super) { - __extends(DynInheritTestMultipleCall10, _super); - function DynInheritTestMultipleCall10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_2.default)(DynInheritTestMultipleCall10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }); - return _this; - } - return DynInheritTestMultipleCall10; - }(GoodInstInheritMultipleCall1)); - var GoodInstInheritMultipleCall2 = /** @class */ (function (_super) { - __extends(GoodInstInheritMultipleCall2, _super); - function GoodInstInheritMultipleCall2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInheritMultipleCall2; - }(DynInheritTestMultipleCall10)); - var DynamicProtoMultipleCallTests = /** @class */ (function (_super) { - __extends(DynamicProtoMultipleCallTests, _super); - function DynamicProtoMultipleCallTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoMultipleCallTests.prototype.testInitialize = function () { - }; - DynamicProtoMultipleCallTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoMultipleCallTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - theTest.testFunction(); - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoMultipleCallTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "MultipleCall: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritMultipleCallTest1(), [ - "InheritTest1()", - "InheritTest1.test()", - "InheritTest1.test()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritMultipleCallTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritMultipleCallTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritMultipleCallTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritMultipleCallTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritMultipleCallTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()", - "DynInheritTest1.test()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritMultipleCallTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritMultipleCallTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritMultipleCallTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritMultipleCallTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritMultipleCallTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritMultipleCallTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInheritMultipleCall1(), [ - "InstInherit1()", - "InstInherit1.test()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInheritMultipleCall2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritMultipleCallTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritMultipleCallTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInheritMultipleCall3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritMultipleCallTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInheritMultipleCall1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTestMultipleCall9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInheritMultipleCall1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTestMultipleCall10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInheritMultipleCall2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()" - ]); - } - }); - }; - return DynamicProtoMultipleCallTests; - }(TestClass)); - exports.DynamicProtoMultipleCallTests = DynamicProtoMultipleCallTests; -}); -/// -define("test/DynamicProtoNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_3) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoNoInstTests = void 0; - var InheritNoInstTest1 = /** @class */ (function () { - function InheritNoInstTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritNoInstTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritNoInstTest1; - }()); - var InheritNoInstTest2 = /** @class */ (function (_super) { - __extends(InheritNoInstTest2, _super); - function InheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritNoInstTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritNoInstTest2; - }(InheritNoInstTest1)); - var InheritNoInstTest3 = /** @class */ (function (_super) { - __extends(InheritNoInstTest3, _super); - function InheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritNoInstTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritNoInstTest3; - }(InheritNoInstTest2)); - var DynInheritNoInstTest1 = /** @class */ (function () { - function DynInheritNoInstTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }, { setInstFuncs: false }); - } - return DynInheritNoInstTest1; - }()); - var InheritNoInstTest4 = /** @class */ (function (_super) { - __extends(InheritNoInstTest4, _super); - function InheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritNoInstTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritNoInstTest4; - }(DynInheritNoInstTest1)); - var InheritNoInstTest5 = /** @class */ (function (_super) { - __extends(InheritNoInstTest5, _super); - function InheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritNoInstTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritNoInstTest5; - }(InheritNoInstTest4)); - var DynInheritNoInstTest2 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest2, _super); - function DynInheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest2; - }(InheritNoInstTest1)); - var DynInheritNoInstTest3 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest3, _super); - function DynInheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest3; - }(DynInheritNoInstTest2)); - var InheritNoInstTest6 = /** @class */ (function (_super) { - __extends(InheritNoInstTest6, _super); - function InheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritNoInstTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritNoInstTest6; - }(DynInheritNoInstTest2)); - var DynInheritNoInstTest4 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest4, _super); - function DynInheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest4; - }(InheritNoInstTest6)); - var DynInheritNoInstTest5 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest5, _super); - function DynInheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest5; - }(DynInheritNoInstTest1)); - var DynInheritNoInstTest6 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest6, _super); - function DynInheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest6; - }(DynInheritNoInstTest5)); - var InstInheritNoInst1 = /** @class */ (function () { - function InstInheritNoInst1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInheritNoInst1; - }()); - var InstInheritNoInst2 = /** @class */ (function (_super) { - __extends(InstInheritNoInst2, _super); - function InstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInheritNoInst2; - }(InheritNoInstTest2)); - var InheritNoInstTest7 = /** @class */ (function (_super) { - __extends(InheritNoInstTest7, _super); - function InheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritNoInstTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritNoInstTest7; - }(InstInheritNoInst1)); - var DynInheritNoInstTest7 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest7, _super); - function DynInheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritNoInstTest7; - }(InstInheritNoInst1)); - var InstInheritNoInst3 = /** @class */ (function (_super) { - __extends(InstInheritNoInst3, _super); - function InstInheritNoInst3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInheritNoInst3; - }(DynInheritNoInstTest7)); - var DynInheritNoInstTest8 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest8, _super); - function DynInheritNoInstTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest8; - }(InstInheritNoInst3)); - var BadInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(BadInstInheritNoInst1, _super); - function BadInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst9 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst9, _super); - function DynInheritTestNoInst9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_3.default)(DynInheritTestNoInst9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst9; - }(BadInstInheritNoInst1)); - var GoodInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst1, _super); - function GoodInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst10 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst10, _super); - function DynInheritTestNoInst10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_3.default)(DynInheritTestNoInst10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst10; - }(GoodInstInheritNoInst1)); - var GoodInstInheritNoInst2 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst2, _super); - function GoodInstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInheritNoInst2; - }(DynInheritTestNoInst10)); - var DynamicProtoNoInstTests = /** @class */ (function (_super) { - __extends(DynamicProtoNoInstTests, _super); - function DynamicProtoNoInstTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoNoInstTests.prototype.testInitialize = function () { - }; - DynamicProtoNoInstTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoNoInstTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "NoInst: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritNoInstTest1(), [ - "InheritTest1()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritNoInstTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritNoInstTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritNoInstTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritNoInstTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritNoInstTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInheritNoInst1(), [ - "InstInherit1()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInheritNoInst2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritNoInstTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInheritNoInst3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - ]); - } - }); - }; - return DynamicProtoNoInstTests; - }(TestClass)); - exports.DynamicProtoNoInstTests = DynamicProtoNoInstTests; -}); -/// -define("test/DynamicProtoMultipleNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_4) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoMultipleNoInstTests = void 0; - var InheritNoInstTest1 = /** @class */ (function () { - function InheritNoInstTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritNoInstTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritNoInstTest1; - }()); - var InheritNoInstTest2 = /** @class */ (function (_super) { - __extends(InheritNoInstTest2, _super); - function InheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritNoInstTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritNoInstTest2; - }(InheritNoInstTest1)); - var InheritNoInstTest3 = /** @class */ (function (_super) { - __extends(InheritNoInstTest3, _super); - function InheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritNoInstTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritNoInstTest3; - }(InheritNoInstTest2)); - var DynInheritNoInstTest1 = /** @class */ (function () { - function DynInheritNoInstTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }, { setInstFuncs: false }); - } - return DynInheritNoInstTest1; - }()); - var InheritNoInstTest4 = /** @class */ (function (_super) { - __extends(InheritNoInstTest4, _super); - function InheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritNoInstTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritNoInstTest4; - }(DynInheritNoInstTest1)); - var InheritNoInstTest5 = /** @class */ (function (_super) { - __extends(InheritNoInstTest5, _super); - function InheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritNoInstTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritNoInstTest5; - }(InheritNoInstTest4)); - var DynInheritNoInstTest2 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest2, _super); - function DynInheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest2; - }(InheritNoInstTest1)); - var DynInheritNoInstTest3 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest3, _super); - function DynInheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest3; - }(DynInheritNoInstTest2)); - var InheritNoInstTest6 = /** @class */ (function (_super) { - __extends(InheritNoInstTest6, _super); - function InheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritNoInstTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritNoInstTest6; - }(DynInheritNoInstTest2)); - var DynInheritNoInstTest4 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest4, _super); - function DynInheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest4; - }(InheritNoInstTest6)); - var DynInheritNoInstTest5 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest5, _super); - function DynInheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest5; - }(DynInheritNoInstTest1)); - var DynInheritNoInstTest6 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest6, _super); - function DynInheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest6; - }(DynInheritNoInstTest5)); - var InstInheritNoInst1 = /** @class */ (function () { - function InstInheritNoInst1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInheritNoInst1; - }()); - var InstInheritNoInst2 = /** @class */ (function (_super) { - __extends(InstInheritNoInst2, _super); - function InstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInheritNoInst2; - }(InheritNoInstTest2)); - var InheritNoInstTest7 = /** @class */ (function (_super) { - __extends(InheritNoInstTest7, _super); - function InheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritNoInstTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritNoInstTest7; - }(InstInheritNoInst1)); - var DynInheritNoInstTest7 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest7, _super); - function DynInheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritNoInstTest7; - }(InstInheritNoInst1)); - var InstInheritNoInst3 = /** @class */ (function (_super) { - __extends(InstInheritNoInst3, _super); - function InstInheritNoInst3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInheritNoInst3; - }(DynInheritNoInstTest7)); - var DynInheritNoInstTest8 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest8, _super); - function DynInheritNoInstTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest8; - }(InstInheritNoInst3)); - var BadInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(BadInstInheritNoInst1, _super); - function BadInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst9 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst9, _super); - function DynInheritTestNoInst9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_4.default)(DynInheritTestNoInst9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst9; - }(BadInstInheritNoInst1)); - var GoodInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst1, _super); - function GoodInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst10 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst10, _super); - function DynInheritTestNoInst10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_4.default)(DynInheritTestNoInst10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst10; - }(GoodInstInheritNoInst1)); - var GoodInstInheritNoInst2 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst2, _super); - function GoodInstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInheritNoInst2; - }(DynInheritTestNoInst10)); - var DynamicProtoMultipleNoInstTests = /** @class */ (function (_super) { - __extends(DynamicProtoMultipleNoInstTests, _super); - function DynamicProtoMultipleNoInstTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoMultipleNoInstTests.prototype.testInitialize = function () { - }; - DynamicProtoMultipleNoInstTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoMultipleNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoMultipleNoInstTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "NoInst: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritNoInstTest1(), [ - "InheritTest1()", - "InheritTest1.test()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritNoInstTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritNoInstTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritNoInstTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritNoInstTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritNoInstTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInheritNoInst1(), [ - "InstInherit1()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInheritNoInst2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritNoInstTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInheritNoInst3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()" - ]); - } - }); - }; - return DynamicProtoMultipleNoInstTests; - }(TestClass)); - exports.DynamicProtoMultipleNoInstTests = DynamicProtoMultipleNoInstTests; -}); -/// -define("test/SecurityCheck.Tests", ["require", "exports", "@nevware21/ts-utils", "src/DynamicProto"], function (require, exports, ts_utils_2, DynamicProto_5) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SecurityCheckTests = void 0; - var HackClass = /** @class */ (function () { - function HackClass() { - this.hello = "world"; - } - return HackClass; - }()); - var BadInstClass = /** @class */ (function () { - function BadInstClass() { - this._dynInstFuncs = {}; - this._dynInstFuncs = Object.prototype; - } - return BadInstClass; - }()); - var BadProxyInstClass = /** @class */ (function () { - function BadProxyInstClass() { - this._dynInstFuncs = {}; - this._dynInstFuncs = new Proxy(this, { - get: function (target, prop) { - if (typeof prop === "string" && prop.startsWith("_dynCls")) { - return Object.prototype; - } - return target[prop]; - } - }); - } - return BadProxyInstClass; - }()); - var SecurityCheckTests = /** @class */ (function (_super) { - __extends(SecurityCheckTests, _super); - function SecurityCheckTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - SecurityCheckTests.prototype.testInitialize = function () { - }; - SecurityCheckTests.prototype.registerTests = function () { - this.testCase({ - name: "Try to update Object.prototype directly", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(Object, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(Object.prototype, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(Object, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with a HackClass instance and __proto__ property", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self.__proto__ = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with a HackClass instance and __proto__ function", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self.__proto__ = function () { - testHack: true; - }; - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - Object.defineProperty(self, "__proto__", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - Object.defineProperty(self, "__proto__", { - value: function () { - testHack: true; - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype using HackClass instance with a __proto__ function", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self.__proto__ = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with HackClass and an object instance", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self.__proto__ = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - Object.defineProperty(self, "__proto__", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - }); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self["__proto__['hacked']"] = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - Object.defineProperty(self, "__proto__['hacked']", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with a HackClass instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self.__proto__ = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly using defineProperty with a HackClass instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - Object.defineProperty(self, "__proto__", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly with a null prototype instance", - test: function () { - var a = {}; - var theInstance = Object.create(a); - try { - (0, DynamicProto_5.default)(theInstance, a, function (_self, base) { - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly with an a prototype instance", - test: function () { - var a = {}; - var theInstance = Object.create(a); - try { - (0, DynamicProto_5.default)(Object.getPrototypeOf(theInstance), a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { - get: function (target, prop) { - if (typeof prop === "string" && prop.startsWith("_dynCls")) { - return Object.prototype; - } - return target[prop]; - } - }); - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var className = _self["_dynClass"]; - var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); - // Change the return class prototype to be Object.prototype - classProto["_dynCls" + className] = Object.prototype; - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - try { - (0, ts_utils_2.objGetPrototypeOf)(base).testHack = true; - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { - get: function (target, prop) { - if (typeof prop === "string" && prop.startsWith("_dynCls")) { - return Array.prototype; - } - return target[prop]; - } - }); - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Array.prototype"); - }; - }); - QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); - } - }); - this.testCase({ - name: "Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var className = _self["_dynClass"]; - var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); - // Change the return class prototype to be Object.prototype - classProto["_dynCls" + className] = Array.prototype; - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Array.prototype"); - }; - }); - QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype with a BadInstClass instance", - test: function () { - var a = new BadInstClass(); - (0, DynamicProto_5.default)(BadInstClass, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype with a BadProxyInstClass instance", - test: function () { - var a = new BadProxyInstClass(); - (0, DynamicProto_5.default)(BadProxyInstClass, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); - } - }); - }; - return SecurityCheckTests; - }(TestClass)); - exports.SecurityCheckTests = SecurityCheckTests; -}); -define("test/Selenium/DynamicProtoTests", ["require", "exports", "test/DynamicProto.Tests", "test/DynamicProtoMultipleCall.Tests", "test/DynamicProtoNoInst.Tests", "test/DynamicProtoMultipleNoInst.Tests", "test/SecurityCheck.Tests"], function (require, exports, DynamicProto_Tests_1, DynamicProtoMultipleCall_Tests_1, DynamicProtoNoInst_Tests_1, DynamicProtoMultipleNoInst_Tests_1, SecurityCheck_Tests_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.runTests = void 0; - function runTests() { - new DynamicProto_Tests_1.DynamicProtoDefaultTests("Default").registerTests(); - new DynamicProtoMultipleCall_Tests_1.DynamicProtoMultipleCallTests("Multiple").registerTests(); - new DynamicProtoNoInst_Tests_1.DynamicProtoNoInstTests("SetInst").registerTests(); - new DynamicProtoMultipleNoInst_Tests_1.DynamicProtoMultipleNoInstTests("Multiple SetInst").registerTests(); - new SecurityCheck_Tests_1.SecurityCheckTests("Security Checks").registerTests(); - } - exports.runTests = runTests; -}); -//# sourceMappingURL=dynamicprototests.js.map \ No newline at end of file diff --git a/lib/test/Selenium/dynamicprototests.js.map b/lib/test/Selenium/dynamicprototests.js.map deleted file mode 100644 index 3b750f5..0000000 --- a/lib/test/Selenium/dynamicprototests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicprototests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/DynamicProto.ts","../DynamicProto.Tests.ts","../DynamicProtoMultipleCall.Tests.ts","../DynamicProtoNoInst.Tests.ts","../DynamicProtoMultipleNoInst.Tests.ts","../SecurityCheck.Tests.ts","DynamicProtoTests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA+C;AAE/C;;;;GAIG;AACH;IAAA;IA2IA,CAAC;IA1IE;;;;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IAAA,sBAAY,EAAC,iBAAiB,EAAE,CAAC,EAAE,UAAC,KAAK,EAAE,IAAI;wBAE1C,KAAa,CAAC,aAAa,GAAG;4BAC3B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;wBACvE,CAAC,CAAA;oBACL,CAAC,CAAC,CAAC;oBAEH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,2CAA2C,CAAC,CAAC;oBAChH,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,2CAA2C,CAAC,CAAC;gBACpH,CAAC;aACJ,CAAC,CAAC;QAEP,CAAC;QACL,yBAAC;IAAD,CAAC,AAnnBD,CAAwC,SAAS,GAmnBhD;IAnnBY,gDAAkB;;;;;;IChC/B,SAAgB,QAAQ;QACpB,IAAI,6CAAwB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;QACxD,IAAI,8DAA6B,CAAC,UAAU,CAAC,CAAC,aAAa,EAAE,CAAC;QAC9D,IAAI,kDAAuB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;QACvD,IAAI,kEAA+B,CAAC,kBAAkB,CAAC,CAAC,aAAa,EAAE,CAAC;QACxE,IAAI,wCAAkB,CAAC,iBAAiB,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9D,CAAC;IAND,4BAMC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\n\ninterface DynamicGlobalSettings {\n /**\n * Stores the global options which will also be exposed on the runtime global\n */\n o: IDynamicProtoOpts,\n\n /**\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\n * @ignore\n */ \n n: number\n};\n\nconst UNDEFINED = \"undefined\";\n\n/**\n * Helper to check if we're running in a server-side rendering environment\n * like Node.js or Cloudflare Workers\n * @ignore\n */\nfunction _isServerSideRender(): boolean {\n const gbl = getGlobal();\n // Check for common server-side environments\n // 1. Missing window or document (Node.js, some SSR frameworks)\n // 2. Cloudflare Worker specific environment\n return (typeof gbl.window === UNDEFINED || \n typeof gbl.document === UNDEFINED ||\n (typeof gbl.navigator !== UNDEFINED && \n typeof gbl.navigator.userAgent !== UNDEFINED && \n gbl.navigator.userAgent.indexOf('Cloudflare-Workers') >= 0));\n}\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Constructor = 'constructor';\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Prototype = 'prototype';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strFunction = 'function';\n\n/**\n * Used to define the name of the instance function lookup table\n * @ignore\n */ \nconst DynInstFuncTable = '_dynInstFuncs';\n \n/**\n * Name used to tag the dynamic prototype function\n * @ignore\n */ \nconst DynProxyTag = '_isDynProxy';\n \n/**\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\n * @ignore\n */ \nconst DynClassName = '_dynClass';\n \n/**\n * Prefix added to the classname to avoid any name clashes with other instance level properties\n * @ignore\n */ \nconst DynClassNamePrefix = '_dynCls$';\n \n/**\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\n * @ignore\n */\nconst DynInstChkTag = '_dynInstChk';\n \n/**\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same \n * tag name as the function level but a different const name for readability only.\n */\nconst DynAllowInstChkTag = DynInstChkTag;\n \n/**\n * The global (imported) instances where the global performance options are stored\n */\nconst DynProtoDefaultOptions = '_dfOpts';\n \n/**\n * Value used as the name of a class when it cannot be determined\n * @ignore\n */ \nconst UnknownValue = '_unknown_';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst str__Proto = \"__proto__\";\n \n/**\n * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\n */\nconst DynProtoBaseProto = \"_dyn\" + str__Proto;\n\n/**\n * Runtime Global holder for dynamicProto settings\n */\nconst DynProtoGlobalSettings = \"__dynProto$Gbl\";\n\n/**\n * Track the current prototype for IE8 as you can't look back to get the prototype\n */\nconst DynProtoCurrent = \"_dynInstProto\";\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strUseBaseInst = 'useBaseInst';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strSetInstFuncs = 'setInstFuncs';\n \nconst Obj = Object;\n\n/**\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\n * @ignore\n */\nlet _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\n\n/**\n * Pre-lookup to check for the existence of this function\n */\nlet _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\n\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\nlet _gbl = getGlobal();\nlet _gblInst: DynamicGlobalSettings = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\n o: {\n [strSetInstFuncs]: true,\n [strUseBaseInst]: true\n },\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\n});\n\n/**\n * Helper used to check whether the target is an Object prototype or Array prototype\n * @ignore\n */ \nfunction _isObjectOrArrayPrototype(target:any) {\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\n}\n\n/**\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\n * @ignore\n */ \nfunction _isObjectArrayOrFunctionPrototype(target:any) {\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\n}\n\n/**\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\n * @ignore\n */ \nfunction _getObjProto(target:any) {\n let newProto;\n\n if (target) {\n // This method doesn't exist in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n return _objGetPrototypeOf(target);\n }\n\n let curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\n\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\n newProto = target[DynProtoBaseProto] || curProto;\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\n target[DynProtoCurrent] = curProto;\n }\n }\n\n return newProto;\n}\n\n/**\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\n * are not enumerable.\n * @param target \n */\nfunction _forEachProp(target: any, func: (name: string) => void) {\n let props: string[] = [];\n if (_objGetOwnProps) {\n props = _objGetOwnProps(target);\n } else {\n for (let name in target) {\n if (typeof name === \"string\" && objHasOwnProperty(target, name)) {\n props.push(name);\n }\n }\n }\n\n if (props && props.length > 0) {\n for (let lp = 0; lp < props.length; lp++) {\n func(props[lp]);\n }\n }\n}\n\n/**\n * Helper function to check whether the provided function name is a potential candidate for dynamic\n * callback and prototype generation.\n * @param target The target object, may be a prototype or class object\n * @param funcName The function name\n * @param skipOwn Skips the check for own property\n * @ignore\n */\nfunction _isDynamicCandidate(target:any, funcName:string, skipOwn:boolean) {\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);\n}\n\n/**\n * Helper to throw a TypeError exception\n * @param message the message\n * @ignore\n */\nfunction _throwTypeError(message:string) {\n throwTypeError(\"DynamicProto: \" + message);\n}\n\n/**\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does \n * not return any inherited functions\n * @param thisTarget The object to get the instance functions from\n * @ignore\n */\nfunction _getInstanceFuncs(thisTarget:any): any {\n // Get the base proto\n var instFuncs = objCreate(null);\n\n // Save any existing instance functions\n _forEachProp(thisTarget, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\n // Create an instance callback for passing the base function to the caller\n instFuncs[name] = thisTarget[name];\n }\n });\n\n return instFuncs;\n}\n\n/**\n * Returns whether the value is included in the array\n * @param values The array of values\n * @param value The value\n */\nfunction _hasVisited(values:any[], value:any) {\n for (let lp = values.length - 1; lp >= 0; lp--) {\n if (values[lp] === value) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\n * @param target The current instance\n * @ignore\n */\nfunction _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseInst:boolean): any {\n function _instFuncProxy(target:any, funcHost: any, funcName: string) {\n let theFunc = funcHost[funcName];\n if (theFunc[DynProxyTag] && useBaseInst) {\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\n let instFuncTable = target[DynInstFuncTable] || {};\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\n }\n }\n\n return function() {\n // eslint-disable-next-line prefer-rest-params\n return theFunc.apply(target, arguments);\n };\n }\n\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\n var baseFuncs = objCreate(null);\n _forEachProp(instFuncs, (name) => {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\n });\n \n // Get the base prototype functions\n var baseProto = _getObjProto(classProto);\n let visited:any[] = [];\n\n // Don't include base object functions for Object, Array or Function\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\n // look for prototype functions\n _forEachProp(baseProto, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\n // the Object prototype methods while bypassing the check\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\n }\n });\n\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(baseProto);\n baseProto = _getObjProto(baseProto);\n }\n\n return baseFuncs;\n}\n\nfunction _getInstFunc(target: any, funcName: string, proto: any, currentDynProtoProxy: any) {\n let instFunc = null;\n\n // We need to check whether the class name is defined directly on this prototype otherwise\n // it will walk the proto chain and return any parent proto classname.\n if (target && objHasOwnProperty(proto, DynClassName)) {\n\n let instFuncTable = target[DynInstFuncTable] || objCreate(null);\n instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[funcName];\n\n if (!instFunc) {\n // Avoid stack overflow from recursive calling the same function\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\n }\n\n // We have the instance function, lets check it we can speed up further calls\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\n // If the instance already has an instance function we can't replace it\n let canAddInst = !objHasOwnProperty(target, funcName);\n\n // Get current prototype\n let objProto = _getObjProto(target);\n let visited:any[] = [];\n\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\n let protoFunc = objProto[funcName];\n if (protoFunc) {\n canAddInst = (protoFunc === currentDynProtoProxy);\n break;\n }\n\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\n visited.push(objProto);\n objProto = _getObjProto(objProto);\n }\n\n try {\n if (canAddInst) {\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\n // so it's safe to directly assign for any subsequent calls (for better performance)\n target[funcName] = instFunc;\n }\n\n // Block further attempts to set the instance function for any\n instFunc[DynInstChkTag] = 1;\n } catch (e) {\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\n // And set a flag so we don't try again for any function\n instFuncTable[DynAllowInstChkTag] = false;\n }\n }\n }\n\n return instFunc;\n}\n\nfunction _getProtoFunc(funcName: string, proto: any, currentDynProtoProxy: any) {\n let protoFunc = proto[funcName];\n\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\n if (protoFunc === currentDynProtoProxy) {\n // It is so lookup the base prototype\n protoFunc = _getObjProto(proto)[funcName];\n }\n\n if (typeof protoFunc !== strFunction) {\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\n }\n\n return protoFunc;\n}\n\n/**\n * Add the required dynamic prototype methods to the the class prototype\n * @param proto - The class prototype\n * @param className - The instance classname \n * @param target - The target instance\n * @param baseInstFuncs - The base instance functions\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\n * @ignore\n */\nfunction _populatePrototype(proto:any, className:string, target:any, baseInstFuncs:any, setInstanceFunc:boolean) {\n function _createDynamicPrototype(proto:any, funcName:string) {\n let dynProtoProxy = function() {\n // Use the instance or prototype function\n let instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\n // eslint-disable-next-line prefer-rest-params\n return instFunc.apply(this, arguments);\n };\n \n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\n // via which can dynamically replace the prototype function reference)\n (dynProtoProxy as any)[DynProxyTag] = 1;\n return dynProtoProxy;\n }\n \n if (!_isObjectOrArrayPrototype(proto)) {\n let instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);\n if (!_isObjectOrArrayPrototype(instFuncTable)) {\n let instFuncs = instFuncTable[className] = (instFuncTable[className] || objCreate(null)); // fetch and assign if as it may not exist yet\n\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\n }\n\n if (!_isObjectOrArrayPrototype(instFuncs)) {\n _forEachProp(target, (name) => {\n // Only add overridden functions\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name] ) {\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\n instFuncs[name] = target[name];\n delete target[name];\n \n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\n if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\n proto[name] = _createDynamicPrototype(proto, name);\n }\n }\n });\n }\n }\n }\n}\n\n/**\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\n * @param classProto The class prototype instance\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\n * @ignore\n */\nfunction _checkPrototype(classProto:any, thisTarget:any) {\n // This method doesn't existing in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\n let visited:any[] = [];\n let thisProto = _getObjProto(thisTarget);\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\n if (thisProto === classProto) {\n return true;\n }\n\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(thisProto);\n thisProto = _getObjProto(thisProto);\n }\n\n return false;\n }\n\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\n return true;\n}\n\n/**\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\n * @param target \n * @param unknownValue \n * @ignore\n */\nfunction _getObjName(target:any, unknownValue?:string) {\n if (objHasOwnProperty(target, Prototype)) {\n // Look like a prototype\n return target.name || unknownValue || UnknownValue\n }\n\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\n}\n\n/**\n * Interface to define additional configuration options to control how the dynamic prototype functions operate.\n */\nexport interface IDynamicProtoOpts {\n\n /**\n * Should the dynamic prototype attempt to set an instance function for instances that do not already have an\n * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function.\n */\n setInstFuncs: boolean,\n\n /**\n * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions\n * and bypass the prototype lookups. Defaults to true.\n */\n useBaseInst?: boolean\n}\n\n/**\n * The delegate signature for the function used as the callback for dynamicProto() \n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even \n * though it is only a proxy that only contains the functions \n * @param theTarget This is the real \"this\" of the current target object\n * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the \"this\" instance before\n * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the \"super\" keyword.\n */\nexport type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPType) => void;\n\n/**\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\n * - Saves references to all defined base class functions\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is \n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\n * ### Usage\n * ```typescript\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\n * class ExampleClass extends BaseClass {\n * constructor() {\n * dynamicProto(ExampleClass, this, (_self, base) => {\n * // This will define a function that will be converted to a prototype function\n * _self.newFunc = () => {\n * // Access any \"this\" instance property \n * if (_self.someProperty) {\n * ...\n * }\n * }\n * // This will define a function that will be converted to a prototype function\n * _self.myFunction = () => {\n * // Access any \"this\" instance property\n * if (_self.someProperty) {\n * // Call the base version of the function that we are overriding\n * base.myFunction();\n * }\n * ...\n * }\n * _self.initialize = () => {\n * ...\n * }\n * // Warnings: While the following will work as _self is simply a reference to\n * // this, if anyone overrides myFunction() the overridden will be called first\n * // as the normal JavaScript method resolution will occur and the defined\n * // _self.initialize() function is actually gets removed from the instance and\n * // a proxy prototype version is created to reference the created method.\n * _self.initialize();\n * });\n * }\n * }\n * ```\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\n * @typeparam DPCls The type that contains the prototype of the current class\n * @param theClass - This is the current class instance which contains the prototype for the current class\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\n * @param options - Additional options to configure how the dynamic prototype operates\n */\nexport default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void {\n // Make sure that the passed theClass argument looks correct\n if (!objHasOwnProperty(theClass, Prototype)) {\n _throwTypeError(\"theClass is an invalid class definition.\");\n }\n\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\n let classProto = theClass[Prototype];\n if (!_checkPrototype(classProto, target)) {\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\n }\n\n let className = null;\n if (objHasOwnProperty(classProto, DynClassName)) {\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\n className = classProto[DynClassName];\n } else {\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\n // function table lookup.\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _gblInst.n ;\n _gblInst.n++;\n classProto[DynClassName] = className;\n }\n\n let perfOptions = dynamicProto[DynProtoDefaultOptions];\n let useBaseInst = !!perfOptions[strUseBaseInst];\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\n useBaseInst = !!options[strUseBaseInst];\n }\n\n // Get the current instance functions\n let instFuncs = _getInstanceFuncs(target);\n\n // Get all of the functions for any base instance (before they are potentially overridden)\n let baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\n\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\n delegateFunc(target, baseFuncs as DPType);\n\n // Don't allow setting instance functions for older IE instances or in SSR environments\n let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isServerSideRender();\n if (setInstanceFunc && options) {\n setInstanceFunc = !!options[strSetInstFuncs];\n }\n\n // Populate the Prototype for any overridden instance functions\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\n}\n\n/**\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\n * their internal usage of dynamic proto.\n */\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritTest3 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritTest4 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritTest5 extends InheritTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest3 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritTest6 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritTest4 extends InheritTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest5 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest6 extends DynInheritTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInherit1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInherit2 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInherit3 extends DynInheritTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritTest8 extends InstInherit3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest9 extends BadInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTest9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest10 extends GoodInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTest10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit2 extends DynInheritTest10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoDefaultTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"Default: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInherit1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInherit2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInherit3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInherit1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTest9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInherit1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTest10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInherit2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritMultipleCallTest3 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritMultipleCallTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest4 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritMultipleCallTest5 extends InheritMultipleCallTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritMultipleCallTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest3 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritMultipleCallTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest6 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest4 extends InheritMultipleCallTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritMultipleCallTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest5 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritMultipleCallTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest6 extends DynInheritMultipleCallTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritMultipleCallTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritMultipleCall2 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritMultipleCallTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall3 extends DynInheritMultipleCallTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritMultipleCallTest8 extends InstInheritMultipleCall3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritMultipleCallTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall9 extends BadInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestMultipleCall9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall10 extends GoodInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestMultipleCall10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall2 extends DynInheritTestMultipleCall10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleCallTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"MultipleCall: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritMultipleCallTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritMultipleCallTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritMultipleCallTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritMultipleCallTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritMultipleCallTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritMultipleCallTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritMultipleCall2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritMultipleCallTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritMultipleCallTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritMultipleCall3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritMultipleCallTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestMultipleCall9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestMultipleCall10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritMultipleCall2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport { objGetPrototypeOf } from \"@nevware21/ts-utils\";\nimport dynamicProto from \"../src/DynamicProto\";\n\nclass HackClass {\n public hello: string;\n\n constructor() {\n this.hello = \"world\";\n }\n}\n\n\nclass BadInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = Object.prototype;\n }\n}\n\nclass BadProxyInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = new Proxy(this, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n }\n}\n\nexport class SecurityCheckTests extends TestClass {\n\n public testInitialize() {\n }\n\n public registerTests() {\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object.prototype, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = () => {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: () => {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype using HackClass instance with a __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n self.__proto__ = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n self.__proto__ = {\n testHack: true\n };\n \n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n \n self.prototype = {\n testHack2: true\n };\n });\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self[\"__proto__['hacked']\"] = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__['hacked']\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance\",\n test: () => {\n let a = new HackClass()\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with a HackClass instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with a null prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n\n try {\n dynamicProto(theInstance, a, (_self, base) => {\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with an a prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n try {\n dynamicProto(Object.getPrototypeOf(theInstance), a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Object.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n try {\n objGetPrototypeOf(base).testHack = true;\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Array.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Array.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadInstClass instance\",\n test: () => {\n let a = new BadInstClass();\n\n dynamicProto(BadInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadProxyInstClass instance\",\n test: () => {\n let a = new BadProxyInstClass();\n\n dynamicProto(BadProxyInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n }\n}\n\n","import { DynamicProtoDefaultTests } from '../DynamicProto.Tests';\nimport { DynamicProtoMultipleCallTests } from '../DynamicProtoMultipleCall.Tests';\nimport { DynamicProtoNoInstTests } from '../DynamicProtoNoInst.Tests';\nimport { DynamicProtoMultipleNoInstTests } from '../DynamicProtoMultipleNoInst.Tests';\nimport { SecurityCheckTests } from '../SecurityCheck.Tests';\n\nexport function runTests() {\n new DynamicProtoDefaultTests(\"Default\").registerTests();\n new DynamicProtoMultipleCallTests(\"Multiple\").registerTests();\n new DynamicProtoNoInstTests(\"SetInst\").registerTests();\n new DynamicProtoMultipleNoInstTests(\"Multiple SetInst\").registerTests();\n new SecurityCheckTests(\"Security Checks\").registerTests();\n}\n"]} \ No newline at end of file diff --git a/rollup/test/Selenium/dynamicprotorolluptests.d.ts b/rollup/test/Selenium/dynamicprotorolluptests.d.ts deleted file mode 100644 index 76808f3..0000000 --- a/rollup/test/Selenium/dynamicprotorolluptests.d.ts +++ /dev/null @@ -1,214 +0,0 @@ -/// -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -declare class Assert { - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static deepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static equal(expected: any, actual: any, message?: string): any; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static notDeepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notEqual(expected: any, actual: any, message?: string): any; - static notPropEqual(expected: any, actual: any, message?: string): any; - static propEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notStrictEqual(expected: any, actual: any, message?: string): any; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - static ok(state: any, message?: string): any; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static strictEqual(expected: any, actual: any, message?: string): any; - /** - * Assertion to test if a callback throws an exception when run. - * - * When testing code that is expected to throw an exception based on a specific set of - * circumstances, use throws() to catch the error object for testing and comparison. - * - * @param block Function to execute - * @param expected Error Object to compare - * @param message A short description of the assertion - */ - static throws(block: () => any, expected: any, message?: string): any; - /** - * @param block Function to execute - * @param message A short description of the assertion - */ - static throws(block: () => any, message?: string): any; -} -/** Defines a test case */ -declare class TestCase { - /** Name to use for the test case */ - name: string; - /** Test case method */ - test: () => void; -} -/** Defines a test case */ -interface TestCaseAsync { - /** Name to use for the test case */ - name: string; - /** time to wait after pre before invoking post and calling start() */ - stepDelay: number; - /** async steps */ - steps: Array<() => void>; -} -declare class TestClass { - constructor(name?: string); - static isPollingStepFlag: string; - /** The instance of the currently running suite. */ - static currentTestClass: TestClass; - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - useFakeTimers: boolean; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - useFakeServer: boolean; - /** Method called before the start of each test method */ - testInitialize(): void; - /** Method called after each test method has completed */ - testCleanup(): void; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - registerTests(): void; - /** Register an async Javascript unit testcase. */ - testCaseAsync(testInfo: TestCaseAsync): void; - /** Register a Javascript unit testcase. */ - testCase(testInfo: TestCase): void; - /** Called when the test is starting. */ - private _testStarting; - /** Called when the test is completed. */ - private _testCompleted; - /**** Sinon methods and properties ***/ - clock: SinonFakeTimers; - server: SinonFakeServer; - sandbox: SinonSandbox; - /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ - spy(): SinonSpy; - /** Spies on the provided function */ - spy(funcToWrap: Function): SinonSpy; - /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ - spy(object: any, methodName: string, func?: Function): SinonSpy; - /** Creates an anonymous stub function. */ - stub(): SinonStub; - /** Stubs all the object's methods. */ - stub(object: any): SinonStub; - /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ - stub(object: any, methodName: string, func?: Function): SinonStub; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - mock(object: any): SinonMock; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; - protected setUserAgent(userAgent: string): void; -} -declare module "src/removeDynamic" { - export interface IDynamicProtoRollupOptions { - tagname?: string; - comment?: string; - sourcemap?: boolean; - } - /** - * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to - * remove the boilerplate code require by typescript to define methods as prototype level while - * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" - * functions from the production code. - */ - export default function dynamicRemove(options?: IDynamicProtoRollupOptions): { - name: string; - renderChunk(code: string, chunk: any): any; - transform: (code: string, id: string) => any; - }; -} -declare module "test/DynamicProtoRollup.Tests" { - export class DynamicProtoRollupTests extends TestClass { - testInitialize(): void; - private visibleNewlines; - private convertNewlines; - private testNoChange; - private doTest; - private testExpected; - private testError; - registerTests(): void; - } -} -declare module "test/Selenium/DynamicProtoRollupTests" { - export function runTests(): void; -} diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js b/rollup/test/Selenium/dynamicprotorolluptests.js deleted file mode 100644 index c9dab61..0000000 --- a/rollup/test/Selenium/dynamicprotorolluptests.js +++ /dev/null @@ -1,1107 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -var Assert = /** @class */ (function () { - function Assert() { - } - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.deepEqual = function (expected, actual, message) { - return deepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.equal = function (expected, actual, message) { - return equal(actual, expected, message); - }; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.notDeepEqual = function (expected, actual, message) { - return notDeepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notEqual = function (expected, actual, message) { - return notEqual(actual, expected, message); - }; - Assert.notPropEqual = function (expected, actual, message) { - return notPropEqual(actual, expected, message); - }; - Assert.propEqual = function (expected, actual, message) { - return propEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notStrictEqual = function (expected, actual, message) { - return notStrictEqual(actual, expected, message); - }; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - Assert.ok = function (state, message) { - return ok(state, message); - }; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.strictEqual = function (expected, actual, message) { - return strictEqual(actual, expected, message); - }; - Assert.throws = function (block, expected, message) { - return throws(block, expected, message); - }; - return Assert; -}()); -/** Defines a test case */ -var TestCase = /** @class */ (function () { - function TestCase() { - } - return TestCase; -}()); -/// -/// -/// -/// -var TestClass = /** @class */ (function () { - function TestClass(name) { - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - this.useFakeTimers = true; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - this.useFakeServer = true; - QUnit.module(name); - } - /** Method called before the start of each test method */ - TestClass.prototype.testInitialize = function () { - }; - /** Method called after each test method has completed */ - TestClass.prototype.testCleanup = function () { - }; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - TestClass.prototype.registerTests = function () { - }; - /** Register an async Javascript unit testcase. */ - TestClass.prototype.testCaseAsync = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (isNaN(testInfo.stepDelay)) { - throw new Error("Must specify 'stepDelay' period between pre and post"); - } - if (!testInfo.steps) { - throw new Error("Must specify 'steps' to take asynchronously"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function (assert) { - var done = assert.async(); - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - var steps_1 = testInfo.steps; - var trigger_1 = function () { - if (steps_1.length) { - var step = steps_1.shift(); - // The callback which activates the next test step. - var nextTestStepTrigger = function () { - setTimeout(function () { - trigger_1(); - }, testInfo.stepDelay); - }; - // There 2 types of test steps - simple and polling. - // Upon completion of the simple test step the next test step will be called. - // In case of polling test step the next test step is passed to the polling test step, and - // it is responsibility of the polling test step to call the next test step. - try { - if (step[TestClass.isPollingStepFlag]) { - step.call(_this, nextTestStepTrigger); - } - else { - step.call(_this); - nextTestStepTrigger.call(_this); - } - } - catch (e) { - _this._testCompleted(); - Assert.ok(false, e.toString()); - // done is QUnit callback indicating the end of the test - done(); - return; - } - } - else { - _this._testCompleted(); - // done is QUnit callback indicating the end of the test - done(); - } - }; - trigger_1(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - // done is QUnit callback indicating the end of the test - done(); - } - }; - // Register the test with QUnit - QUnit.test(testInfo.name, testMethod); - }; - /** Register a Javascript unit testcase. */ - TestClass.prototype.testCase = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (!testInfo.test) { - throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function () { - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - testInfo.test.call(_this); - _this._testCompleted(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - } - }; - // Register the test with QUnit - test(testInfo.name, testMethod); - }; - /** Called when the test is starting. */ - TestClass.prototype._testStarting = function () { - // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. - var config = sinon.getConfig(sinon.config); - config.useFakeTimers = this.useFakeTimers; - config.useFakeServer = this.useFakeServer; - config.injectInto = config.injectIntoThis && this || config.injectInto; - this.sandbox = sinon.sandbox.create(config); - this.server = this.sandbox.server; - // Allow the derived class to perform test initialization. - this.testInitialize(); - }; - /** Called when the test is completed. */ - TestClass.prototype._testCompleted = function (failed) { - if (failed) { - // Just cleanup the sandbox since the test has already failed. - this.sandbox.restore(); - } - else { - // Verify the sandbox and restore. - this.sandbox.verifyAndRestore(); - } - this.testCleanup(); - // Clear the instance of the currently running suite. - TestClass.currentTestClass = null; - }; - TestClass.prototype.spy = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - TestClass.prototype.stub = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - TestClass.prototype.mock = function (object) { return null; }; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { - if (errorCode === undefined) { - errorCode = 200; - } - request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); - }; - TestClass.prototype.setUserAgent = function (userAgent) { - Object.defineProperty(window.navigator, 'userAgent', { - configurable: true, - get: function () { - return userAgent; - } - }); - }; - TestClass.isPollingStepFlag = "isPollingStep"; - return TestClass; -}()); -// Configure Sinon -sinon.assert.fail = function (msg) { - Assert.ok(false, msg); -}; -sinon.assert.pass = function (assertion) { - Assert.ok(assertion, "sinon assert"); -}; -sinon.config = { - injectIntoThis: true, - injectInto: null, - properties: ["spy", "stub", "mock", "clock", "sandbox"], - useFakeTimers: true, - useFakeServer: true -}; -/// -/// -/// -/// -/// -define("src/removeDynamic", ["require", "exports", "magic-string"], function (require, exports, magic_string_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - ; - function escape(str) { - return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); - } - function isSourceMapEnabled(options) { - if (options) { - return options.sourceMap !== false && options.sourcemap !== false; - } - return false; - } - // Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always - // exists in the build / test infrastructure - function padEnd(input, len, fill) { - var value = input || ""; - while (value.length < len) { - value += fill; - } - if (value.length > len) { - value = value.substring(0, len); - } - return value; - } - function isNullOrWhitespace(value) { - if (value) { - return value.replace(/\s/g, "").length < 1; - } - return true; - } - /** - * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to - * remove the boilerplate code require by typescript to define methods as prototype level while - * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" - * functions from the production code. - */ - function dynamicRemove(options) { - if (options === void 0) { options = {}; } - var token = (options || {}).tagname || "@DynamicProtoStub"; - var replaceValue = (options || {}).comment || "// Removed Stub for %function%."; - var tokenGroups = [4, 10, 13]; - var funcNameGroup = 6; - // Because of the test infrastructure (PhamtonJS) the RegEx can't use the "s" flag (gis vs gi) or named groups - var pattern = new RegExp("([\\t ]*\\/\\*\\*((?!\\*\\/)(.|\\r|\\n))*\\*\\/[\\s]*)*(\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*(\\r\\n|\\n\\r|\\r|\\n))*[\\t ]*([\\w]*\\.prototype(\\.|\\[\\\"|\\[\\')[\\w]*(\\\"\\]|\\'\\])?)[\\t ]*=[\\t ]*function[\\t ]*\\([^\\{]*\\{[^\\/\\}\\{]*(\\{[^\\}]*\\}[^\\/\\}\\{]*)*(\\/[\\*\\/][\\t ]*" + escape(token) + "[^\\*\\r\\n]*(\\*\\/)?(\\r\\n|\\n\\r|\\r|\\n))*[^\\}]*\\};([\\t ]*\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*)*", 'gi'); - function formatError(token, code, pos, id) { - var lines = code.split(/(?:\r\n|\n\r|\r|\n)/); - var lineNumber = 0; - var count = pos; - while (count > 0) { - lineNumber++; - count = code.lastIndexOf("\n", count - 1); - } - var column = 0; - var lineStart = code.lastIndexOf("\n", pos); - if (lineStart != -1) { - column = (pos - lineStart); - } - else { - column = pos + 1; - } - var message = "Invalid (Unremoved) token [" + token + "] found on line [" + lineNumber + "], column [" + column + "], position [" + pos + "] - " + (id || "") + "\n"; - var marker = padEnd("", token.length, "^"); - var line = lineNumber - 6; - if (line > 0) { - message += " ...\n"; - } - count = 0; - while (count < 10 && line < lines.length - 1) { - count++; - if (line >= 0) { - var number = padEnd("" + (line + 1), 4, " "); - message += number + ":" + lines[line] + "\n"; - if (line == lineNumber - 1) { - message += padEnd("", column + 4, " ") + marker + "\n"; - } - } - line++; - } - if (line < lines.length - 1) { - message += " ...\n"; - } - var match; - var matchCount = 0; - while ((match = pattern.exec(code))) { - var funcName = match[funcNameGroup]; - if (!isNullOrWhitespace(funcName)) { - if (matchCount == 0) { - message += "\nMatch checks\n"; - } - matchCount++; - if (match[0].length > 0) { - message += "Match " + matchCount + " tag Groups for " + (funcName || "") + "\n"; - message += "--=( Complete Matched Content )=--\n"; - message += match[0]; - message += "\n--------------------------------\n"; - for (var lp = 1; lp < match.length; lp++) { - if (match[lp]) { - message += "" + lp + ": " + (match[lp] || "").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); - if ((match[lp] || "").indexOf(token) != -1) { - message += " <- Contains tag"; - } - message += "\n"; - } - } - message += "\n"; - } - } - } - return message; - } - function replaceToken(code, theString) { - var result = false; - var match; - while ((match = pattern.exec(code))) { - var funcName = match[funcNameGroup]; - if (!isNullOrWhitespace(funcName)) { - // Only remove matches that contain a tag and function - var hasToken = false; - for (var lp = 0; lp < tokenGroups.length; lp++) { - if ((match[tokenGroups[lp]] || "").indexOf(token) != -1) { - hasToken = true; - break; - } - } - if (hasToken) { - result = true; - var start_1 = match.index; - var newValue = replaceValue.replace("%function%", funcName); - theString.overwrite(start_1, start_1 + match[0].length, newValue); - } - } - } - return result; - } - function checkResult(result, id) { - if (result) { - var pos = result.indexOf(token); - if (pos != -1) { - throw new Error(formatError(token, result, pos, id)); - } - } - } - function doTransform(code, id) { - var theString = new magic_string_1.default(code); - if (!replaceToken(code, theString)) { - return null; - } - var result = { code: theString.toString() }; - if (isSourceMapEnabled(options)) { - result.map = theString.generateMap({ hires: true }); - } - return result; - } - function doTransformAndCheck(code, id) { - var result = doTransform(code, id); - if (result) { - // Do a final check of the string - checkResult(result.code, id); - } - else { - // Check that the raw input doesn't include the tag - checkResult(code, id); - } - return result; - } - return { - name: 'dynamicRemove', - renderChunk: function (code, chunk) { - return doTransformAndCheck(code, chunk.filename); - }, - transform: doTransformAndCheck - }; - } - exports.default = dynamicRemove; -}); -/// -define("test/DynamicProtoRollup.Tests", ["require", "exports", "src/removeDynamic"], function (require, exports, removeDynamic_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoRollupTests = void 0; - var DynamicProtoRollupTests = /** @class */ (function (_super) { - __extends(DynamicProtoRollupTests, _super); - function DynamicProtoRollupTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoRollupTests.prototype.testInitialize = function () { - }; - DynamicProtoRollupTests.prototype.visibleNewlines = function (value) { - if (value) { - return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n"); - } - return value; - }; - DynamicProtoRollupTests.prototype.convertNewlines = function (value, newline) { - if (value) { - return value.replace(/\n/g, newline); - } - return value; - }; - DynamicProtoRollupTests.prototype.testNoChange = function (options, input) { - var plugin = (0, removeDynamic_1.default)(options); - QUnit.assert.equal(plugin.name, "dynamicRemove"); - QUnit.assert.equal(plugin.renderChunk(input, { filename: "test.js" }), null); - QUnit.assert.equal(plugin.transform(input, "testId"), null); - }; - DynamicProtoRollupTests.prototype.doTest = function (options, input, expected) { - this.testExpected(options, input, expected); - this.testExpected(options, this.convertNewlines(input, "\r"), this.convertNewlines(expected, "\r")); - this.testExpected(options, this.convertNewlines(input, "\r\n"), this.convertNewlines(expected, "\r\n")); - this.testExpected(options, this.convertNewlines(input, "\n\r"), this.convertNewlines(expected, "\n\r")); - }; - DynamicProtoRollupTests.prototype.testExpected = function (options, input, expected) { - var plugin = (0, removeDynamic_1.default)(options); - QUnit.assert.equal(plugin.name, "dynamicRemove"); - var result = plugin.renderChunk(input, { filename: "test.js" }); - QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); - result = plugin.transform(input, "testId"); - QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); - }; - DynamicProtoRollupTests.prototype.testError = function (options, message, input, expected) { - var plugin = (0, removeDynamic_1.default)(options); - QUnit.assert.throws(function () { - plugin.renderChunk(input, { filename: "test.js" }); - }, new Error(expected), message); - QUnit.assert.throws(function () { - plugin.transform(input, "test.js"); - }, new Error(expected), message); - }; - DynamicProtoRollupTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "No matching values for removal", - test: function () { - _this.testNoChange(null, "Nothing removed"); - _this.testNoChange(null, "ClassName.prototype.anotherMethod = function () {\n};\n"); - _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n"); - _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n"); - _this.testNoChange(null, "// @Stub -- Type 1 comment\n" + - "function methodName() {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n"); - _this.testNoChange(null, "function methodName() {\n" + - " // @Stub -- Type 2 single line comment\n" + - "};\n"); - _this.testNoChange(null, "function methodName() {\n" + - " /* @Stub -- Type 2 multiline comment */\n" + - "};\n"); - _this.testNoChange(null, "function methodName() {\n" + - " /* @Stub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n"); - } - }); - this.testCase({ - name: "Basic tag patterns", - test: function () { - _this.doTest(null, "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + - " // @DynamicProtoStub -- Type 2 single line comment\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - } - }); - this.testCase({ - name: "Mixed tagtype combinations", - test: function () { - _this.doTest(null, - // Input, - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + - " }; // @DynamicProtoStub - Tag type 3\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + - " // @DynamicProtoStub - Tag type 2.1\n" + - " };\n" + - " TestClass.prototype.func5 = function () {\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + - " /* @DynamicProtoStub - Tag type 2.2 */\n" + - " };\n" + - " return TestClass;", - // Expected Value - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - "// Removed Stub for TestClass.prototype.func1.\n" + - "// Removed Stub for TestClass.prototype.func2.\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func4.\n" + - " TestClass.prototype.func5 = function () {\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func6.\n" + - " return TestClass;"); - _this.testExpected(null, - // Input, - " /**\r\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r\n" + - " * @param coreConfig - The core configuration.\r\n" + - " * @param core - The AppInsights core.\r\n" + - " * @param extensions - An array of all the plugins being used.\r\n" + - " */\r\n" + - " // @DynamicProtoStub \r\n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\r\n" + - " };\r\n" + - " /**\r" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r" + - " * @param coreConfig - The core configuration.\r" + - " * @param core - The AppInsights core.\r" + - " * @param extensions - An array of all the plugins being used.\r" + - " */\r" + - " // @DynamicProtoStub \r" + - " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\r" + - " };\r" + - " /**\n\r" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n\r" + - " * @param coreConfig - The core configuration.\n\r" + - " * @param core - The AppInsights core.\n\r" + - " * @param extensions - An array of all the plugins being used.\n\r" + - " */\n\r" + - " // @DynamicProtoStub \n\r" + - " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n\r" + - " };\n\r" + - "", - // Expected Value - "// Removed Stub for TestClass.prototype.func1.\r\n" + - "// Removed Stub for TestClass.prototype.func2.\r" + - "// Removed Stub for TestClass.prototype.func3.\n\r"); - } - }); - this.testCase({ - name: "Stubs with return values", - test: function () { - _this.doTest(null, - // Input, - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + - " return;\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + - " return;\n" + - " }; // @DynamicProtoStub - Tag type 3\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + - " // @DynamicProtoStub - Tag type 2.1\n" + - " return;\n" + - " };\n" + - " TestClass.prototype.func5 = function () {\n" + - " return;\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + - " /* @DynamicProtoStub - Tag type 2.2 */\n" + - " return;\n" + - " };\n" + - " return TestClass;", - // Expected Value - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - "// Removed Stub for TestClass.prototype.func1.\n" + - "// Removed Stub for TestClass.prototype.func2.\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func4.\n" + - " TestClass.prototype.func5 = function () {\n" + - " return;\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func6.\n" + - " return TestClass;"); - _this.doTest(null, - // Input, - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - "", - // Expected Value - "// Removed Stub for TestClass.prototype.func1.\n" + - "// Removed Stub for TestClass.prototype.func2.\n" + - "// Removed Stub for TestClass.prototype.func3.\n"); - } - }); - this.testCase({ - name: "Test reserved (ES3) function names", - test: function () { - _this.doTest(null, - // Input, - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype[\"catch2\"] = function (evt, itemCtx) {\n" + - " return;\n" + - " }; // @DynamicProtoStub - Tag type 3\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype[\"func3\"] = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - " return TestClass;", - // Expected Value - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - "// Removed Stub for TestClass.prototype[\"catch\"].\n" + - "// Removed Stub for TestClass.prototype[\"catch2\"].\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype[\"func3\"] = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - " return TestClass;"); - _this.doTest(null, - // Input, - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"delete\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"throw\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - "", - // Expected Value - "// Removed Stub for TestClass.prototype[\"catch\"].\n" + - "// Removed Stub for TestClass.prototype[\"delete\"].\n" + - "// Removed Stub for TestClass.prototype[\"throw\"].\n" + - "// Removed Stub for TestClass.prototype['if'].\n"); - } - }); - this.testCase({ - name: "Test unconverted tags from partial conversion", - test: function () { - _this.testError(null, "1 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + - "function methodName() {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + - "1 :// @DynamicProtoStub -- Type 1 comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "2 :function methodName() {\n" + - "3 : // This is a comment for a dynamic proto stub\n" + - "4 :};\n"); - _this.testError(null, "2 -- Type 2 single line comment", "function methodName() {\n" + - " // @DynamicProtoStub -- Type 2 single line comment\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n"); - _this.testError(null, "3 -- Type 2 multiline comment", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n"); - _this.testError(null, "4 -- Type 2 multiline comment (2)", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 : * Continuation of a multi-line comment/\n" + - "4 : */\n" + - "5 :};\n"); - _this.testError(null, "5 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + - "function methodName() {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + - "1 :// @DynamicProtoStub -- Type 1 comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "2 :function methodName() {\n" + - "3 : // This is a comment for a dynamic proto stub\n" + - "4 :};\n" + - "5 :// Removed Stub for ClassName.prototype.methodName.\n"); - _this.testError(null, "6 -- Type 2 single line comment", "function methodName() {\n" + - " // @DynamicProtoStub -- Type 2 single line comment\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n" + - "4 :// Removed Stub for ClassName.prototype.methodName.\n"); - _this.testError(null, "7 -- Type 2 multiline comment */", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n" + - "4 :// Removed Stub for ClassName.prototype.methodName.\n"); - _this.testError(null, "8 -- Type 2 multiline comment (2)", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 : * Continuation of a multi-line comment/\n" + - "4 : */\n" + - "5 :};\n" + - "6 :// Removed Stub for ClassName.prototype.methodName.\n"); - } - }); - this.testCase({ - name: "Test prefixed comment with typescript boilerplate for spread and default arguments", - test: function () { - _this.doTest(null, "/**\n" + - " * This method tells if given durations should be excluded from collection.\n" + - " */\n" + - "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + - " var durations = [];\n" + - " for (var _i = 0; _i < arguments.length; _i++) {\n" + - " durations[_i] = arguments[_i];\n" + - " }\n" + - " // @DynamicProtoStub\n" + - " return true;\n" + - "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); - _this.doTest(null, " /**\n" + - " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + - " * Fall back to xhr sender if beacon is not supported.\n" + - " * @param {boolean} [async=true]\n" + - " * @memberof Initialization\n" + - " */\n" + - "Initialization.prototype.onunloadFlush = function (async) {\n" + - " if (async === void 0) { async = true; }\n" + - " // @DynamicProtoStub\n" + - "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); - _this.doTest(null, "/**\n" + - " * This method tells if given durations should be excluded from collection.\n" + - " */\n" + - "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + - " var durations = [];\n" + - " for (var _i = 0; _i < arguments.length; _i++) {\n" + - " durations[_i] = arguments[_i];\n" + - " }\n" + - " /* @DynamicProtoStub\n" + - " */\n" + - " return true;\n" + - "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); - _this.doTest(null, " /**\n" + - " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + - " * Fall back to xhr sender if beacon is not supported.\n" + - " * @param {boolean} [async=true]\n" + - " * @memberof Initialization\n" + - " */\n" + - "Initialization.prototype.onunloadFlush = function (async) {\n" + - " if (async === void 0) { async = true; }\n" + - " /* @DynamicProtoStub\n" + - " */\n" + - "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); - } - }); - }; - return DynamicProtoRollupTests; - }(TestClass)); - exports.DynamicProtoRollupTests = DynamicProtoRollupTests; -}); -define("test/Selenium/DynamicProtoRollupTests", ["require", "exports", "test/DynamicProtoRollup.Tests"], function (require, exports, DynamicProtoRollup_Tests_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.runTests = void 0; - function runTests() { - new DynamicProtoRollup_Tests_1.DynamicProtoRollupTests().registerTests(); - } - exports.runTests = runTests; -}); -//# sourceMappingURL=dynamicprotorolluptests.js.map \ No newline at end of file diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js.map b/rollup/test/Selenium/dynamicprotorolluptests.js.map deleted file mode 100644 index 6d144f9..0000000 --- a/rollup/test/Selenium/dynamicprotorolluptests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicprotorolluptests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/removeDynamic.ts","../DynamicProtoRollup.Tests.ts","DynamicProtoRollupTests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA+C;AAE/C;;;;GAIG;AACH;IAAA;IA2IA,CAAC;IA1IE;;;;;;;;;;;OAWG;IACY,gBAAS,GAAvB,UAAwB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAChE,OAAO,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,YAAK,GAAnB,UAAoB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAC5D,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,mBAAY,GAA1B,UAA2B,QAAa,EAAE,MAAW,EAAE,OAAgB;QACnE,OAAO,YAAY,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;wBAC/B,OAAO;wBACP,+DAA+D;wBAC/D,8CAA8C;wBAC9C,4BAA4B;wBAC5B,UAAU;wBACV,MAAM,EACN,+DAA+D,CAAC,CAAC;gBACrE,CAAC;aACR,CAAC,CAAC;QACP,CAAC;QACL,8BAAC;IAAD,CAAC,AAppBD,CAA6C,SAAS,GAopBrD;IAppBY,0DAAuB;;;;;;ICFpC,SAAgB,QAAQ;QACpB,IAAI,kDAAuB,EAAE,CAAC,aAAa,EAAE,CAAC;IAClD,CAAC;IAFD,4BAEC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","import MagicString from 'magic-string';\n\nexport interface IDynamicProtoRollupOptions {\n tagname?: string,\n comment?:string,\n sourcemap?: boolean\n};\n\nfunction escape(str:string) {\n return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\n\nfunction isSourceMapEnabled(options:any) {\n if (options) {\n return options.sourceMap !== false && options.sourcemap !== false;\n }\n\n return false;\n}\n\n// Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always\n// exists in the build / test infrastructure\nfunction padEnd(input:string, len:number, fill:string) {\n let value = input||\"\";\n while (value.length < len) {\n value += fill;\n }\n\n if (value.length > len) {\n value = value.substring(0, len);\n }\n\n return value;\n}\n\nfunction isNullOrWhitespace(value:string) {\n if (value) {\n return value.replace(/\\s/g, \"\").length < 1;\n }\n\n return true;\n}\n\n/**\n * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to\n * remove the boilerplate code require by typescript to define methods as prototype level while\n * using @ms-dynamicProto project to support minification. This can also be used to remove \"debug\"\n * functions from the production code.\n */\nexport default function dynamicRemove(options:IDynamicProtoRollupOptions = {}) {\n var token = (options || {}).tagname || \"@DynamicProtoStub\";\n var replaceValue = (options || {}).comment || \"// Removed Stub for %function%.\";\n let tokenGroups:Array = [4, 10, 13];\n let funcNameGroup:number = 6;\n\n // Because of the test infrastructure (PhamtonJS) the RegEx can't use the \"s\" flag (gis vs gi) or named groups\n const pattern = new RegExp(\"([\\\\t ]*\\\\/\\\\*\\\\*((?!\\\\*\\\\/)(.|\\\\r|\\\\n))*\\\\*\\\\/[\\\\s]*)*(\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[\\\\t ]*([\\\\w]*\\\\.prototype(\\\\.|\\\\[\\\\\\\"|\\\\[\\\\')[\\\\w]*(\\\\\\\"\\\\]|\\\\'\\\\])?)[\\\\t ]*=[\\\\t ]*function[\\\\t ]*\\\\([^\\\\{]*\\\\{[^\\\\/\\\\}\\\\{]*(\\\\{[^\\\\}]*\\\\}[^\\\\/\\\\}\\\\{]*)*(\\\\/[\\\\*\\\\/][\\\\t ]*\" + escape(token) + \"[^\\\\*\\\\r\\\\n]*(\\\\*\\\\/)?(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[^\\\\}]*\\\\};([\\\\t ]*\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*)*\", 'gi');\n\n function formatError(token:string, code:string, pos:number, id:string) {\n let lines = code.split(/(?:\\r\\n|\\n\\r|\\r|\\n)/);\n let lineNumber = 0;\n let count = pos;\n while (count > 0) {\n lineNumber ++;\n count = code.lastIndexOf(\"\\n\", count - 1);\n }\n \n let column = 0;\n let lineStart = code.lastIndexOf(\"\\n\", pos);\n if (lineStart != -1) {\n column = (pos - lineStart);\n } else {\n column = pos + 1;\n }\n \n var message = \"Invalid (Unremoved) token [\" + token + \"] found on line [\" + lineNumber + \"], column [\" + column + \"], position [\" + pos + \"] - \" + (id||\"\") + \"\\n\";\n \n let marker = padEnd(\"\", token.length, \"^\");\n let line = lineNumber - 6;\n if (line > 0) {\n message += \" ...\\n\";\n }\n \n count = 0;\n while (count < 10 && line < lines.length-1) {\n count++;\n if (line >= 0) {\n let number = padEnd(\"\" + (line + 1), 4, \" \");\n message += number + \":\" + lines[line] + \"\\n\";\n if (line == lineNumber-1) {\n message += padEnd(\"\", column + 4, \" \") + marker + \"\\n\";\n }\n }\n \n line++;\n }\n \n if (line < lines.length-1) {\n message += \" ...\\n\";\n }\n \n let match;\n let matchCount = 0;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n if (matchCount == 0) {\n message += \"\\nMatch checks\\n\";\n }\n\n matchCount++;\n if (match[0].length > 0) {\n message += \"Match \" + matchCount + \" tag Groups for \" + (funcName||\"\") + \"\\n\";\n message += \"--=( Complete Matched Content )=--\\n\";\n message += match[0];\n message += \"\\n--------------------------------\\n\";\n for(let lp = 1; lp < match.length; lp++) {\n if (match[lp]) {\n message += \"\" + lp + \": \" + (match[lp] || \"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n if ((match[lp]||\"\").indexOf(token) != -1) {\n message += \" <- Contains tag\";\n }\n message += \"\\n\";\n }\n }\n message += \"\\n\";\n }\n }\n }\n \n return message;\n }\n\n function replaceToken(code:string, theString:MagicString) {\n let result = false;\n let match;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n // Only remove matches that contain a tag and function\n let hasToken = false;\n for(let lp = 0; lp < tokenGroups.length; lp++) {\n if ((match[tokenGroups[lp]]||\"\").indexOf(token) != -1) {\n hasToken = true;\n break;\n }\n }\n \n if (hasToken) {\n result = true;\n let start = match.index;\n let newValue = replaceValue.replace(\"%function%\", funcName);\n theString.overwrite(start, start + match[0].length, newValue);\n }\n }\n }\n\n return result;\n }\n\n function checkResult(result:string, id:string) {\n if (result) {\n let pos = result.indexOf(token);\n if (pos != -1) {\n throw new Error(formatError(token, result, pos, id));\n }\n }\n }\n\n function doTransform(code:string, id:string) {\n let theString = new MagicString(code);\n if (!replaceToken(code, theString)) {\n return null;\n }\n\n let result:any = { code: theString.toString() };\n if (isSourceMapEnabled(options)) {\n result.map = theString.generateMap({hires: true});\n }\n\n return result;\n }\n\n function doTransformAndCheck(code:string, id:string) {\n let result = doTransform(code, id);\n if (result) {\n // Do a final check of the string\n checkResult(result.code, id);\n } else {\n // Check that the raw input doesn't include the tag\n checkResult(code, id);\n }\n\n return result;\n }\n\n return {\n name: 'dynamicRemove',\n renderChunk(code:string, chunk:any) {\n return doTransformAndCheck(code, chunk.filename);\n },\n transform: doTransformAndCheck\n }\n}\n \n ","/// \n\nimport dynamicRemove from '../src/removeDynamic';\n\nexport class DynamicProtoRollupTests extends TestClass {\n\n public testInitialize() {\n }\n\n private visibleNewlines(value) {\n if (value) {\n return value.replace(/\\r/g, \"\\\\r\").replace(/\\n/g, \"\\\\n\");\n }\n\n return value;\n }\n\n private convertNewlines(value, newline) {\n if (value) {\n return value.replace(/\\n/g, newline);\n }\n\n return value;\n }\n\n private testNoChange(options:any, input:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n QUnit.assert.equal(plugin.renderChunk(input, { filename: \"test.js\" }), null);\n QUnit.assert.equal(plugin.transform(input, \"testId\"), null);\n }\n\n private doTest(options:any, input:string, expected:string) {\n this.testExpected(options, input, expected);\n this.testExpected(options, this.convertNewlines(input, \"\\r\"), this.convertNewlines(expected, \"\\r\"));\n this.testExpected(options, this.convertNewlines(input, \"\\r\\n\"), this.convertNewlines(expected, \"\\r\\n\"));\n this.testExpected(options, this.convertNewlines(input, \"\\n\\r\"), this.convertNewlines(expected, \"\\n\\r\"));\n }\n\n private testExpected(options:any, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n let result = plugin.renderChunk(input, { filename: \"test.js\" });\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n\n result = plugin.transform(input, \"testId\");\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n }\n\n private testError(options:any, message:string, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.throws(() => {\n plugin.renderChunk(input, { filename: \"test.js\" });\n }, new Error(expected), message);\n\n QUnit.assert.throws(() => {\n plugin.transform(input, \"test.js\");\n }, new Error(expected), message);\n }\n\n public registerTests() {\n this.testCase({\n name: \"No matching values for removal\",\n test: () => {\n this.testNoChange(null, \"Nothing removed\");\n\n this.testNoChange(null, \"ClassName.prototype.anotherMethod = function () {\\n};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"// @Stub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" // @Stub -- Type 2 single line comment\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment */\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\");\n }\n });\n\n this.testCase({\n name: \"Basic tag patterns\",\n test: () => {\n this.doTest(null, \n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n this.testCase({\n name: \"Mixed tagtype combinations\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.testExpected(null, \n // Input, \n \" /**\\r\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\\n\" + \n \" * @param coreConfig - The core configuration.\\r\\n\" + \n \" * @param core - The AppInsights core.\\r\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\r\\n\" + \n \" */\\r\\n\" + \n \" // @DynamicProtoStub \\r\\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\r\\n\" + \n \" };\\r\\n\" + \n \" /**\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\" + \n \" * @param coreConfig - The core configuration.\\r\" + \n \" * @param core - The AppInsights core.\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\r\" + \n \" */\\r\" + \n \" // @DynamicProtoStub \\r\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\r\" + \n \" };\\r\" + \n \" /**\\n\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\\r\" + \n \" * @param coreConfig - The core configuration.\\n\\r\" + \n \" * @param core - The AppInsights core.\\n\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\n\\r\" + \n \" */\\n\\r\" + \n \" // @DynamicProtoStub \\n\\r\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\\r\" + \n \" };\\n\\r\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\r\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\r\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\\r\"\n );\n }\n });\n\n this.testCase({\n name: \"Stubs with return values\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test reserved (ES3) function names\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"catch2\\\"] = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch2\\\"].\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" +\n \" return TestClass;\",\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"delete\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"throw\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype[\\\"delete\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"throw\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype['if'].\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test unconverted tags from partial conversion\",\n test: () => {\n this.testError(null, \n \"1 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\");\n \n this.testError(null, \n \"2 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"3 -- Type 2 multiline comment\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"4 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\");\n\n this.testError(null,\n \"5 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\" +\n \"5 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n\n \n this.testError(null,\n \"6 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"7 -- Type 2 multiline comment */\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"8 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\" +\n \"6 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n\n this.testCase({\n name: \"Test prefixed comment with typescript boilerplate for spread and default arguments\",\n test: () => {\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" // @DynamicProtoStub\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" // @DynamicProtoStub\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n }\n });\n }\n}\n","import { DynamicProtoRollupTests } from '../DynamicProtoRollup.Tests';\n\nexport function runTests() {\n new DynamicProtoRollupTests().registerTests();\n}\n"]} \ No newline at end of file From 48c624c534fd40fdb63e02a788aeefc02f5bcdfb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 23:48:53 +0000 Subject: [PATCH 08/22] Add try/catch in _instFuncProxy for additional SSR protection Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 10 ++++++++-- package.json | 12 ++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index f806590..155963c 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -302,8 +302,14 @@ function _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseIns } return function() { - // eslint-disable-next-line prefer-rest-params - return theFunc.apply(target, arguments); + try { + // eslint-disable-next-line prefer-rest-params + return theFunc.apply(target, arguments); + } catch (e) { + // Provide protection in case we're in a restricted environment like Cloudflare Workers + // that doesn't allow property redefinition or other operations + return null; + } }; } diff --git a/package.json b/package.json index 70bab56..ad71d96 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,13 @@ }, "devDependencies": { "@microsoft/rush": "5.148.0", - "@nevware21/grunt-ts-plugin": "^0.3.0", "@nevware21/grunt-eslint-ts": "^0.1.0", + "@nevware21/grunt-ts-plugin": "^0.3.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^2.3.3", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", + "copyfiles": "^2.4.1", "eslint": "^7.29.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.23.4", @@ -63,12 +66,9 @@ "grunt-contrib-qunit": "^4.0.0", "grunt-contrib-uglify": "^5.0.1", "grunt-run": "^0.8.1", - "@rollup/plugin-node-resolve": "^9.0.0", - "@rollup/plugin-replace": "^2.3.3", - "rollup-plugin-cleanup": "3.2.1", "rollup": "^2.32.0", + "rollup-plugin-cleanup": "3.2.1", "typedoc": "^0.23.25", - "typescript": "^4.9.5", - "copyfiles": "^2.4.1" + "typescript": "^4.9.5" } } From 9820de13868790216de33d324adcc76b53deaea2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 May 2025 23:55:44 +0000 Subject: [PATCH 09/22] Add additional try/catch blocks for Cloudflare Worker protection Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index 155963c..187ff7b 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -443,7 +443,11 @@ function _populatePrototype(proto:any, className:string, target:any, baseInstFun // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) - (dynProtoProxy as any)[DynProxyTag] = 1; + try { + (dynProtoProxy as any)[DynProxyTag] = 1; + } catch (e) { + // Ignore errors in restricted environments like Cloudflare Workers + } return dynProtoProxy; } @@ -463,7 +467,11 @@ function _populatePrototype(proto:any, className:string, target:any, baseInstFun if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name] ) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs[name] = target[name]; - delete target[name]; + try { + delete target[name]; + } catch (e) { + // Ignore errors in restricted environments like Cloudflare Workers + } // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { @@ -624,7 +632,11 @@ export default function dynamicProto(theClass:DPCls, target:DPTyp // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n ; _gblInst.n++; - classProto[DynClassName] = className; + try { + classProto[DynClassName] = className; + } catch (e) { + // Ignore errors in restricted environments like Cloudflare Workers + } } let perfOptions = dynamicProto[DynProtoDefaultOptions]; From ed2296091b1c1e6e2b0a26de752cd319a617f89b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 00:11:15 +0000 Subject: [PATCH 10/22] Use helpers from ts-utils for server-side detection and revert try-catch Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 23 ++++++++--------------- package.json | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index 187ff7b..efb6de2 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from "@nevware21/ts-utils"; +import { getGlobal, objCreate, objHasOwnProperty, throwTypeError, hasWindow, hasDocument, hasNavigator, getNavigator } from "@nevware21/ts-utils"; interface DynamicGlobalSettings { /** @@ -24,15 +24,14 @@ const UNDEFINED = "undefined"; * @ignore */ function _isServerSideRender(): boolean { - const gbl = getGlobal(); // Check for common server-side environments // 1. Missing window or document (Node.js, some SSR frameworks) // 2. Cloudflare Worker specific environment - return (typeof gbl.window === UNDEFINED || - typeof gbl.document === UNDEFINED || - (typeof gbl.navigator !== UNDEFINED && - typeof gbl.navigator.userAgent !== UNDEFINED && - gbl.navigator.userAgent.indexOf('Cloudflare-Workers') >= 0)); + return (!hasWindow() || + !hasDocument() || + (hasNavigator() && + getNavigator().userAgent && + getNavigator().userAgent.indexOf('Cloudflare-Workers') >= 0)); } /** @@ -302,14 +301,8 @@ function _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseIns } return function() { - try { - // eslint-disable-next-line prefer-rest-params - return theFunc.apply(target, arguments); - } catch (e) { - // Provide protection in case we're in a restricted environment like Cloudflare Workers - // that doesn't allow property redefinition or other operations - return null; - } + // eslint-disable-next-line prefer-rest-params + return theFunc.apply(target, arguments); }; } diff --git a/package.json b/package.json index ad71d96..f8bbd8b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ }, "homepage": "https://github.com/microsoft/DynamicProto-JS#readme", "dependencies": { - "@nevware21/ts-utils": ">= 0.11.6 < 2.x" + "@nevware21/ts-utils": "^0.12.4" }, "devDependencies": { "@microsoft/rush": "5.148.0", From 6374c7eb5419961ac31ea04d7367400d27005497 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 00:25:00 +0000 Subject: [PATCH 11/22] Revert package.json ordering changes Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f8bbd8b..987bf75 100644 --- a/package.json +++ b/package.json @@ -47,13 +47,10 @@ }, "devDependencies": { "@microsoft/rush": "5.148.0", - "@nevware21/grunt-eslint-ts": "^0.1.0", "@nevware21/grunt-ts-plugin": "^0.3.0", - "@rollup/plugin-node-resolve": "^9.0.0", - "@rollup/plugin-replace": "^2.3.3", + "@nevware21/grunt-eslint-ts": "^0.1.0", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", - "copyfiles": "^2.4.1", "eslint": "^7.29.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.23.4", @@ -66,9 +63,12 @@ "grunt-contrib-qunit": "^4.0.0", "grunt-contrib-uglify": "^5.0.1", "grunt-run": "^0.8.1", - "rollup": "^2.32.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^2.3.3", "rollup-plugin-cleanup": "3.2.1", + "rollup": "^2.32.0", "typedoc": "^0.23.25", - "typescript": "^4.9.5" + "typescript": "^4.9.5", + "copyfiles": "^2.4.1" } } From c541a2e783a229897bfbb37d8cc42ad77410360f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 00:58:14 +0000 Subject: [PATCH 12/22] Update ts-utils dependency range to >=0.12.4 <1.0.0 per review feedback Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 987bf75..26ae575 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ }, "homepage": "https://github.com/microsoft/DynamicProto-JS#readme", "dependencies": { - "@nevware21/ts-utils": "^0.12.4" + "@nevware21/ts-utils": ">=0.12.4 <1.0.0" }, "devDependencies": { "@microsoft/rush": "5.148.0", From 507dad4b55870fd5808be839c6005c34660662fe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 01:20:41 +0000 Subject: [PATCH 13/22] Replace hasNavigator() with !!getNavigator() per review feedback Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index ffb71f3..d51529d 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { getGlobal, objCreate, objHasOwnProperty, throwTypeError, hasWindow, hasDocument, hasNavigator, getNavigator } from "@nevware21/ts-utils"; +import { getGlobal, objCreate, objHasOwnProperty, throwTypeError, hasWindow, hasDocument, getNavigator } from "@nevware21/ts-utils"; interface DynamicGlobalSettings { /** @@ -29,7 +29,7 @@ function _isServerSideRender(): boolean { // 2. Cloudflare Worker specific environment return (!hasWindow() || !hasDocument() || - (hasNavigator() && + (!!getNavigator() && getNavigator().userAgent && getNavigator().userAgent.indexOf('Cloudflare-Workers') >= 0)); } From 32afc77752fbaa22942abf499e64fe666f932b3e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 18:01:26 +0000 Subject: [PATCH 14/22] Address PR review feedback Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 6 +++--- lib/tsconfig.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index d51529d..dda2c50 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { getGlobal, objCreate, objHasOwnProperty, throwTypeError, hasWindow, hasDocument, getNavigator } from "@nevware21/ts-utils"; +import { getGlobal, objCreate, objHasOwnProperty, throwTypeError, getWindow, getDocument, getNavigator } from "@nevware21/ts-utils"; interface DynamicGlobalSettings { /** @@ -27,8 +27,8 @@ function _isServerSideRender(): boolean { // Check for common server-side environments // 1. Missing window or document (Node.js, some SSR frameworks) // 2. Cloudflare Worker specific environment - return (!hasWindow() || - !hasDocument() || + return (!getWindow() || + !getDocument() || (!!getNavigator() && getNavigator().userAgent && getNavigator().userAgent.indexOf('Cloudflare-Workers') >= 0)); diff --git a/lib/tsconfig.json b/lib/tsconfig.json index bf035bb..77db2e3 100644 --- a/lib/tsconfig.json +++ b/lib/tsconfig.json @@ -14,6 +14,7 @@ "declarationDir": "./types", "outDir": "./dist-es5", "rootDir": "./src", + "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "removeComments": false }, From fc1fbd03b7506458a1e312c0c3312aef12b3567a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 19:06:07 +0000 Subject: [PATCH 15/22] Refine detection of restricted environments for Cloudflare Workers Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- README.md | 4 +- RELEASES.md | 6 +- lib/src/DynamicProto.ts | 42 +- lib/test/Selenium/dynamicprototests.d.ts | 301 ++ lib/test/Selenium/dynamicprototests.js | 3802 ++++++++++++++++++++ lib/test/Selenium/dynamicprototests.js.map | 1 + package.json | 12 +- 7 files changed, 4143 insertions(+), 25 deletions(-) create mode 100644 lib/test/Selenium/dynamicprototests.d.ts create mode 100644 lib/test/Selenium/dynamicprototests.js create mode 100644 lib/test/Selenium/dynamicprototests.js.map diff --git a/README.md b/README.md index 1f9ea5d..fab2795 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ The version 2.x is maintained on the default [main branch](https://github.com/mi ## Server-Side Rendering Support -As of version 2.0.4, DynamicProto-JS includes support for Server-Side Rendering (SSR) environments, including Cloudflare Workers. In SSR contexts, the library automatically detects the environment and provides simplified functionality that avoids operations that might cause issues in restricted environments. +As of version 2.0.4, DynamicProto-JS includes support for restricted JavaScript environments, including Cloudflare Workers and some Angular SSR environments. In these contexts, the library automatically detects environments where property redefinition is restricted and provides simplified functionality that avoids operations that would cause issues. -This ensures compatibility with Angular SSR and other server-side frameworks without requiring additional configuration. +This ensures compatibility with Angular SSR, Cloudflare Workers, and other restricted environments without requiring additional configuration. ## Documentation diff --git a/RELEASES.md b/RELEASES.md index 17194da..4661894 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5,9 +5,9 @@ ### Changes - #95 [BUG] AppInsights breaks Angular SSR in Cloudflare Worker - - Added support for Server-Side Rendering environments, including Cloudflare Workers - - Modified the `dynamicProto` function to detect SSR environments and avoid operations that cause issues with property redefinition - - This ensures compatibility with Angular SSR and other server-side frameworks + - Added support for restricted JavaScript environments, including Cloudflare Workers + - Modified the `dynamicProto` function to detect environments where property redefinition is restricted + - This ensures compatibility with Angular SSR, Cloudflare Workers, and other restricted environments ## 2.0.3 (Jan 11th, 2024) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index dda2c50..c29f651 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { getGlobal, objCreate, objHasOwnProperty, throwTypeError, getWindow, getDocument, getNavigator } from "@nevware21/ts-utils"; +import { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from "@nevware21/ts-utils"; interface DynamicGlobalSettings { /** @@ -19,19 +19,33 @@ interface DynamicGlobalSettings { /** - * Helper to check if we're running in a server-side rendering environment - * like Node.js or Cloudflare Workers + * Helper to check if we're running in a restricted environment that doesn't support + * property redefinition, like Cloudflare Workers. This is primarily used to avoid + * operations that would cause issues in these environments. * @ignore */ -function _isServerSideRender(): boolean { - // Check for common server-side environments - // 1. Missing window or document (Node.js, some SSR frameworks) - // 2. Cloudflare Worker specific environment - return (!getWindow() || - !getDocument() || - (!!getNavigator() && - getNavigator().userAgent && - getNavigator().userAgent.indexOf('Cloudflare-Workers') >= 0)); +function _isRestrictedEnvironment(): boolean { + try { + // Test if we can perform property definition/redefinition + // This specifically targets restricted environments like Cloudflare Workers + // where property redefinition causes errors + let testObj = {}; + let testProp = "testProperty"; + Object.defineProperty(testObj, testProp, { + configurable: true, + value: 1 + }); + Object.defineProperty(testObj, testProp, { + configurable: true, + value: 2 + }); + + // If we can redefine properties, not a restricted environment + return false; + } catch (e) { + // If property redefinition fails, we're in a restricted environment + return true; + } } /** @@ -648,8 +662,8 @@ export default function dynamicProto(theClass:DPCls, target:DPTyp // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs as DPType); - // Don't allow setting instance functions for older IE instances or in SSR environments - let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isServerSideRender(); + // Don't allow setting instance functions in older browsers or restricted environments + let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isRestrictedEnvironment(); if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } diff --git a/lib/test/Selenium/dynamicprototests.d.ts b/lib/test/Selenium/dynamicprototests.d.ts new file mode 100644 index 0000000..5b2eebd --- /dev/null +++ b/lib/test/Selenium/dynamicprototests.d.ts @@ -0,0 +1,301 @@ +/// +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +declare class Assert { + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static deepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static equal(expected: any, actual: any, message?: string): any; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static notDeepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notEqual(expected: any, actual: any, message?: string): any; + static notPropEqual(expected: any, actual: any, message?: string): any; + static propEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notStrictEqual(expected: any, actual: any, message?: string): any; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + static ok(state: any, message?: string): any; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static strictEqual(expected: any, actual: any, message?: string): any; + /** + * Assertion to test if a callback throws an exception when run. + * + * When testing code that is expected to throw an exception based on a specific set of + * circumstances, use throws() to catch the error object for testing and comparison. + * + * @param block Function to execute + * @param expected Error Object to compare + * @param message A short description of the assertion + */ + static throws(block: () => any, expected: any, message?: string): any; + /** + * @param block Function to execute + * @param message A short description of the assertion + */ + static throws(block: () => any, message?: string): any; +} +/** Defines a test case */ +declare class TestCase { + /** Name to use for the test case */ + name: string; + /** Test case method */ + test: () => void; +} +/** Defines a test case */ +interface TestCaseAsync { + /** Name to use for the test case */ + name: string; + /** time to wait after pre before invoking post and calling start() */ + stepDelay: number; + /** async steps */ + steps: Array<() => void>; +} +declare class TestClass { + constructor(name?: string); + static isPollingStepFlag: string; + /** The instance of the currently running suite. */ + static currentTestClass: TestClass; + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + useFakeTimers: boolean; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + useFakeServer: boolean; + /** Method called before the start of each test method */ + testInitialize(): void; + /** Method called after each test method has completed */ + testCleanup(): void; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + registerTests(): void; + /** Register an async Javascript unit testcase. */ + testCaseAsync(testInfo: TestCaseAsync): void; + /** Register a Javascript unit testcase. */ + testCase(testInfo: TestCase): void; + /** Called when the test is starting. */ + private _testStarting; + /** Called when the test is completed. */ + private _testCompleted; + /**** Sinon methods and properties ***/ + clock: SinonFakeTimers; + server: SinonFakeServer; + sandbox: SinonSandbox; + /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ + spy(): SinonSpy; + /** Spies on the provided function */ + spy(funcToWrap: Function): SinonSpy; + /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ + spy(object: any, methodName: string, func?: Function): SinonSpy; + /** Creates an anonymous stub function. */ + stub(): SinonStub; + /** Stubs all the object's methods. */ + stub(object: any): SinonStub; + /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ + stub(object: any, methodName: string, func?: Function): SinonStub; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + mock(object: any): SinonMock; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; + protected setUserAgent(userAgent: string): void; +} +declare module "src/DynamicProto" { + /** + * Interface to define additional configuration options to control how the dynamic prototype functions operate. + */ + export interface IDynamicProtoOpts { + /** + * Should the dynamic prototype attempt to set an instance function for instances that do not already have an + * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function. + */ + setInstFuncs: boolean; + /** + * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions + * and bypass the prototype lookups. Defaults to true. + */ + useBaseInst?: boolean; + } + /** + * The delegate signature for the function used as the callback for dynamicProto() + * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even + * though it is only a proxy that only contains the functions + * @param theTarget This is the real "this" of the current target object + * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the "this" instance before + * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the "super" keyword. + */ + export type DynamicProtoDelegate = (theTarget: DPType, baseFuncProxy?: DPType) => void; + /** + * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- + * - Saves references to all defined base class functions + * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. + * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. + * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is + * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of + * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" + * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions + * defined in the constructor or some other function (rather than declared as complete typescript functions). + * ### Usage + * ```typescript + * import dynamicProto from "@microsoft/dynamicproto-js"; + * class ExampleClass extends BaseClass { + * constructor() { + * dynamicProto(ExampleClass, this, (_self, base) => { + * // This will define a function that will be converted to a prototype function + * _self.newFunc = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * ... + * } + * } + * // This will define a function that will be converted to a prototype function + * _self.myFunction = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * // Call the base version of the function that we are overriding + * base.myFunction(); + * } + * ... + * } + * _self.initialize = () => { + * ... + * } + * // Warnings: While the following will work as _self is simply a reference to + * // this, if anyone overrides myFunction() the overridden will be called first + * // as the normal JavaScript method resolution will occur and the defined + * // _self.initialize() function is actually gets removed from the instance and + * // a proxy prototype version is created to reference the created method. + * _self.initialize(); + * }); + * } + * } + * ``` + * @typeparam DPType This is the generic type of the class, used to keep intellisense valid + * @typeparam DPCls The type that contains the prototype of the current class + * @param theClass - This is the current class instance which contains the prototype for the current class + * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. + * @param delegateFunc - The callback function (closure) that will create the dynamic function + * @param options - Additional options to configure how the dynamic prototype operates + */ + export default function dynamicProto(theClass: DPCls, target: DPType, delegateFunc: DynamicProtoDelegate, options?: IDynamicProtoOpts): void; +} +declare module "test/DynamicProto.Tests" { + export class DynamicProtoDefaultTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/DynamicProtoMultipleCall.Tests" { + export class DynamicProtoMultipleCallTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/DynamicProtoNoInst.Tests" { + export class DynamicProtoNoInstTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/DynamicProtoMultipleNoInst.Tests" { + export class DynamicProtoMultipleNoInstTests extends TestClass { + testInitialize(): void; + private _validateOrder; + private doTest; + registerTests(): void; + } +} +declare module "test/SecurityCheck.Tests" { + export class SecurityCheckTests extends TestClass { + testInitialize(): void; + registerTests(): void; + } +} +declare module "test/Selenium/DynamicProtoTests" { + export function runTests(): void; +} diff --git a/lib/test/Selenium/dynamicprototests.js b/lib/test/Selenium/dynamicprototests.js new file mode 100644 index 0000000..9e605cf --- /dev/null +++ b/lib/test/Selenium/dynamicprototests.js @@ -0,0 +1,3802 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +var Assert = /** @class */ (function () { + function Assert() { + } + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.deepEqual = function (expected, actual, message) { + return deepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.equal = function (expected, actual, message) { + return equal(actual, expected, message); + }; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.notDeepEqual = function (expected, actual, message) { + return notDeepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notEqual = function (expected, actual, message) { + return notEqual(actual, expected, message); + }; + Assert.notPropEqual = function (expected, actual, message) { + return notPropEqual(actual, expected, message); + }; + Assert.propEqual = function (expected, actual, message) { + return propEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notStrictEqual = function (expected, actual, message) { + return notStrictEqual(actual, expected, message); + }; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + Assert.ok = function (state, message) { + return ok(state, message); + }; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.strictEqual = function (expected, actual, message) { + return strictEqual(actual, expected, message); + }; + Assert.throws = function (block, expected, message) { + return throws(block, expected, message); + }; + return Assert; +}()); +/** Defines a test case */ +var TestCase = /** @class */ (function () { + function TestCase() { + } + return TestCase; +}()); +/// +/// +/// +/// +var TestClass = /** @class */ (function () { + function TestClass(name) { + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + this.useFakeTimers = true; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + this.useFakeServer = true; + QUnit.module(name); + } + /** Method called before the start of each test method */ + TestClass.prototype.testInitialize = function () { + }; + /** Method called after each test method has completed */ + TestClass.prototype.testCleanup = function () { + }; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + TestClass.prototype.registerTests = function () { + }; + /** Register an async Javascript unit testcase. */ + TestClass.prototype.testCaseAsync = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (isNaN(testInfo.stepDelay)) { + throw new Error("Must specify 'stepDelay' period between pre and post"); + } + if (!testInfo.steps) { + throw new Error("Must specify 'steps' to take asynchronously"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function (assert) { + var done = assert.async(); + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + var steps_1 = testInfo.steps; + var trigger_1 = function () { + if (steps_1.length) { + var step = steps_1.shift(); + // The callback which activates the next test step. + var nextTestStepTrigger = function () { + setTimeout(function () { + trigger_1(); + }, testInfo.stepDelay); + }; + // There 2 types of test steps - simple and polling. + // Upon completion of the simple test step the next test step will be called. + // In case of polling test step the next test step is passed to the polling test step, and + // it is responsibility of the polling test step to call the next test step. + try { + if (step[TestClass.isPollingStepFlag]) { + step.call(_this, nextTestStepTrigger); + } + else { + step.call(_this); + nextTestStepTrigger.call(_this); + } + } + catch (e) { + _this._testCompleted(); + Assert.ok(false, e.toString()); + // done is QUnit callback indicating the end of the test + done(); + return; + } + } + else { + _this._testCompleted(); + // done is QUnit callback indicating the end of the test + done(); + } + }; + trigger_1(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + // done is QUnit callback indicating the end of the test + done(); + } + }; + // Register the test with QUnit + QUnit.test(testInfo.name, testMethod); + }; + /** Register a Javascript unit testcase. */ + TestClass.prototype.testCase = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (!testInfo.test) { + throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function () { + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + testInfo.test.call(_this); + _this._testCompleted(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + } + }; + // Register the test with QUnit + test(testInfo.name, testMethod); + }; + /** Called when the test is starting. */ + TestClass.prototype._testStarting = function () { + // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. + var config = sinon.getConfig(sinon.config); + config.useFakeTimers = this.useFakeTimers; + config.useFakeServer = this.useFakeServer; + config.injectInto = config.injectIntoThis && this || config.injectInto; + this.sandbox = sinon.sandbox.create(config); + this.server = this.sandbox.server; + // Allow the derived class to perform test initialization. + this.testInitialize(); + }; + /** Called when the test is completed. */ + TestClass.prototype._testCompleted = function (failed) { + if (failed) { + // Just cleanup the sandbox since the test has already failed. + this.sandbox.restore(); + } + else { + // Verify the sandbox and restore. + this.sandbox.verifyAndRestore(); + } + this.testCleanup(); + // Clear the instance of the currently running suite. + TestClass.currentTestClass = null; + }; + TestClass.prototype.spy = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + TestClass.prototype.stub = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + TestClass.prototype.mock = function (object) { return null; }; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { + if (errorCode === undefined) { + errorCode = 200; + } + request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); + }; + TestClass.prototype.setUserAgent = function (userAgent) { + Object.defineProperty(window.navigator, 'userAgent', { + configurable: true, + get: function () { + return userAgent; + } + }); + }; + TestClass.isPollingStepFlag = "isPollingStep"; + return TestClass; +}()); +// Configure Sinon +sinon.assert.fail = function (msg) { + Assert.ok(false, msg); +}; +sinon.assert.pass = function (assertion) { + Assert.ok(assertion, "sinon assert"); +}; +sinon.config = { + injectIntoThis: true, + injectInto: null, + properties: ["spy", "stub", "mock", "clock", "sandbox"], + useFakeTimers: true, + useFakeServer: true +}; +/// +/// +/// +/// +/// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +define("src/DynamicProto", ["require", "exports", "@nevware21/ts-utils"], function (require, exports, ts_utils_1) { + "use strict"; + var _a; + Object.defineProperty(exports, "__esModule", { value: true }); + ; + /** + * Helper to check if we're running in a restricted environment that doesn't support + * property redefinition, like Cloudflare Workers. This is primarily used to avoid + * operations that would cause issues in these environments. + * @ignore + */ + function _isRestrictedEnvironment() { + try { + // Test if we can perform property definition/redefinition + // This specifically targets restricted environments like Cloudflare Workers + // where property redefinition causes errors + var testObj = {}; + var testProp = "testProperty"; + Object.defineProperty(testObj, testProp, { + configurable: true, + value: 1 + }); + Object.defineProperty(testObj, testProp, { + configurable: true, + value: 2 + }); + // If we can redefine properties, not a restricted environment + return false; + } + catch (e) { + // If property redefinition fails, we're in a restricted environment + return true; + } + } + /** + * Constant string defined to support minimization + * @ignore + */ + var Constructor = 'constructor'; + /** + * Constant string defined to support minimization + * @ignore + */ + var Prototype = 'prototype'; + /** + * Constant string defined to support minimization + * @ignore + */ + var strFunction = 'function'; + /** + * Used to define the name of the instance function lookup table + * @ignore + */ + var DynInstFuncTable = '_dynInstFuncs'; + /** + * Name used to tag the dynamic prototype function + * @ignore + */ + var DynProxyTag = '_isDynProxy'; + /** + * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table + * @ignore + */ + var DynClassName = '_dynClass'; + /** + * Prefix added to the classname to avoid any name clashes with other instance level properties + * @ignore + */ + var DynClassNamePrefix = '_dynCls$'; + /** + * A tag which is used to check if we have already to attempted to set the instance function if one is not present + * @ignore + */ + var DynInstChkTag = '_dynInstChk'; + /** + * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same + * tag name as the function level but a different const name for readability only. + */ + var DynAllowInstChkTag = DynInstChkTag; + /** + * The global (imported) instances where the global performance options are stored + */ + var DynProtoDefaultOptions = '_dfOpts'; + /** + * Value used as the name of a class when it cannot be determined + * @ignore + */ + var UnknownValue = '_unknown_'; + /** + * Constant string defined to support minimization + * @ignore + */ + var str__Proto = "__proto__"; + /** + * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist + */ + var DynProtoBaseProto = "_dyn" + str__Proto; + /** + * Runtime Global holder for dynamicProto settings + */ + var DynProtoGlobalSettings = "__dynProto$Gbl"; + /** + * Track the current prototype for IE8 as you can't look back to get the prototype + */ + var DynProtoCurrent = "_dynInstProto"; + /** + * Constant string defined to support minimization + * @ignore + */ + var strUseBaseInst = 'useBaseInst'; + /** + * Constant string defined to support minimization + * @ignore + */ + var strSetInstFuncs = 'setInstFuncs'; + var Obj = Object; + /** + * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) + * @ignore + */ + var _objGetPrototypeOf = Obj["getPrototypeOf"]; + /** + * Pre-lookup to check for the existence of this function + */ + var _objGetOwnProps = Obj["getOwnPropertyNames"]; + // Since 1.1.7 moving these to the runtime global to work around mixed version and module issues + // See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details + var _gbl = (0, ts_utils_1.getGlobal)(); + var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { + o: (_a = {}, + _a[strSetInstFuncs] = true, + _a[strUseBaseInst] = true, + _a), + n: 1000 // Start new global index @ 1000 so we "fix" some cases when mixed with 1.1.6 or earlier + }); + /** + * Helper used to check whether the target is an Object prototype or Array prototype + * @ignore + */ + function _isObjectOrArrayPrototype(target) { + return target && (target === Obj[Prototype] || target === Array[Prototype]); + } + /** + * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype + * @ignore + */ + function _isObjectArrayOrFunctionPrototype(target) { + return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; + } + /** + * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. + * @ignore + */ + function _getObjProto(target) { + var newProto; + if (target) { + // This method doesn't exist in older browsers (e.g. IE8) + if (_objGetPrototypeOf) { + return _objGetPrototypeOf(target); + } + var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); + // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class + newProto = target[DynProtoBaseProto] || curProto; + if (!(0, ts_utils_1.objHasOwnProperty)(target, DynProtoBaseProto)) { + // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it + // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) + delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy + newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; + target[DynProtoCurrent] = curProto; + } + } + return newProto; + } + /** + * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 + * are not enumerable. + * @param target + */ + function _forEachProp(target, func) { + var props = []; + if (_objGetOwnProps) { + props = _objGetOwnProps(target); + } + else { + for (var name_1 in target) { + if (typeof name_1 === "string" && (0, ts_utils_1.objHasOwnProperty)(target, name_1)) { + props.push(name_1); + } + } + } + if (props && props.length > 0) { + for (var lp = 0; lp < props.length; lp++) { + func(props[lp]); + } + } + } + /** + * Helper function to check whether the provided function name is a potential candidate for dynamic + * callback and prototype generation. + * @param target The target object, may be a prototype or class object + * @param funcName The function name + * @param skipOwn Skips the check for own property + * @ignore + */ + function _isDynamicCandidate(target, funcName, skipOwn) { + return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || (0, ts_utils_1.objHasOwnProperty)(target, funcName)) && funcName !== str__Proto && funcName !== Prototype); + } + /** + * Helper to throw a TypeError exception + * @param message the message + * @ignore + */ + function _throwTypeError(message) { + (0, ts_utils_1.throwTypeError)("DynamicProto: " + message); + } + /** + * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does + * not return any inherited functions + * @param thisTarget The object to get the instance functions from + * @ignore + */ + function _getInstanceFuncs(thisTarget) { + // Get the base proto + var instFuncs = (0, ts_utils_1.objCreate)(null); + // Save any existing instance functions + _forEachProp(thisTarget, function (name) { + // Don't include any dynamic prototype instances - as we only want the real functions + if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { + // Create an instance callback for passing the base function to the caller + instFuncs[name] = thisTarget[name]; + } + }); + return instFuncs; + } + /** + * Returns whether the value is included in the array + * @param values The array of values + * @param value The value + */ + function _hasVisited(values, value) { + for (var lp = values.length - 1; lp >= 0; lp--) { + if (values[lp] === value) { + return true; + } + } + return false; + } + /** + * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" + * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references + * @param target The current instance + * @ignore + */ + function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { + function _instFuncProxy(target, funcHost, funcName) { + var theFunc = funcHost[funcName]; + if (theFunc[DynProxyTag] && useBaseInst) { + // grab and reuse the hosted looking function (if available) otherwise the original passed function + var instFuncTable = target[DynInstFuncTable] || {}; + if (instFuncTable[DynAllowInstChkTag] !== false) { + theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; + } + } + return function () { + // eslint-disable-next-line prefer-rest-params + return theFunc.apply(target, arguments); + }; + } + // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) + var baseFuncs = (0, ts_utils_1.objCreate)(null); + _forEachProp(instFuncs, function (name) { + // Create an instance callback for passing the base function to the caller + baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); + }); + // Get the base prototype functions + var baseProto = _getObjProto(classProto); + var visited = []; + // Don't include base object functions for Object, Array or Function + while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { + // look for prototype functions + _forEachProp(baseProto, function (name) { + // Don't include any dynamic prototype instances - as we only want the real functions + // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the + // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return + // the Object prototype methods while bypassing the check + if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { + // Create an instance callback for passing the base function to the caller + baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); + } + }); + // We need to find all possible functions that might be overloaded by walking the entire prototype chain + // This avoids the caller from needing to check whether it's direct base class implements the function or not + // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. + visited.push(baseProto); + baseProto = _getObjProto(baseProto); + } + return baseFuncs; + } + function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { + var instFunc = null; + // We need to check whether the class name is defined directly on this prototype otherwise + // it will walk the proto chain and return any parent proto classname. + if (target && (0, ts_utils_1.objHasOwnProperty)(proto, DynClassName)) { + var instFuncTable = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); + instFunc = (instFuncTable[proto[DynClassName]] || (0, ts_utils_1.objCreate)(null))[funcName]; + if (!instFunc) { + // Avoid stack overflow from recursive calling the same function + _throwTypeError("Missing [" + funcName + "] " + strFunction); + } + // We have the instance function, lets check it we can speed up further calls + // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) + if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { + // If the instance already has an instance function we can't replace it + var canAddInst = !(0, ts_utils_1.objHasOwnProperty)(target, funcName); + // Get current prototype + var objProto = _getObjProto(target); + var visited = []; + // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function + // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut + while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { + var protoFunc = objProto[funcName]; + if (protoFunc) { + canAddInst = (protoFunc === currentDynProtoProxy); + break; + } + // We need to find all possible initial functions to ensure that we don't bypass a valid override function + visited.push(objProto); + objProto = _getObjProto(objProto); + } + try { + if (canAddInst) { + // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version + // so it's safe to directly assign for any subsequent calls (for better performance) + target[funcName] = instFunc; + } + // Block further attempts to set the instance function for any + instFunc[DynInstChkTag] = 1; + } + catch (e) { + // Don't crash if the object is readonly or the runtime doesn't allow changing this + // And set a flag so we don't try again for any function + instFuncTable[DynAllowInstChkTag] = false; + } + } + } + return instFunc; + } + function _getProtoFunc(funcName, proto, currentDynProtoProxy) { + var protoFunc = proto[funcName]; + // Check that the prototype function is not a self reference -- try to avoid stack overflow! + if (protoFunc === currentDynProtoProxy) { + // It is so lookup the base prototype + protoFunc = _getObjProto(proto)[funcName]; + } + if (typeof protoFunc !== strFunction) { + _throwTypeError("[" + funcName + "] is not a " + strFunction); + } + return protoFunc; + } + /** + * Add the required dynamic prototype methods to the the class prototype + * @param proto - The class prototype + * @param className - The instance classname + * @param target - The target instance + * @param baseInstFuncs - The base instance functions + * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist + * @ignore + */ + function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { + function _createDynamicPrototype(proto, funcName) { + var dynProtoProxy = function () { + // Use the instance or prototype function + var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); + // eslint-disable-next-line prefer-rest-params + return instFunc.apply(this, arguments); + }; + // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing + // via which can dynamically replace the prototype function reference) + try { + dynProtoProxy[DynProxyTag] = 1; + } + catch (e) { + // Ignore errors in restricted environments like Cloudflare Workers + } + return dynProtoProxy; + } + if (!_isObjectOrArrayPrototype(proto)) { + var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); + if (!_isObjectOrArrayPrototype(instFuncTable)) { + var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || (0, ts_utils_1.objCreate)(null)); // fetch and assign if as it may not exist yet + // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable + if (instFuncTable[DynAllowInstChkTag] !== false) { + instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; + } + if (!_isObjectOrArrayPrototype(instFuncs_1)) { + _forEachProp(target, function (name) { + // Only add overridden functions + if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { + // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function + instFuncs_1[name] = target[name]; + try { + delete target[name]; + } + catch (e) { + // Ignore errors in restricted environments like Cloudflare Workers + } + // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one + if (!(0, ts_utils_1.objHasOwnProperty)(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { + proto[name] = _createDynamicPrototype(proto, name); + } + } + }); + } + } + } + } + /** + * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance + * @param classProto The class prototype instance + * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy + * @ignore + */ + function _checkPrototype(classProto, thisTarget) { + // This method doesn't existing in older browsers (e.g. IE8) + if (_objGetPrototypeOf) { + // As this is primarily a coding time check, don't bother checking if running in IE8 or lower + var visited = []; + var thisProto = _getObjProto(thisTarget); + while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { + if (thisProto === classProto) { + return true; + } + // This avoids the caller from needing to check whether it's direct base class implements the function or not + // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. + visited.push(thisProto); + thisProto = _getObjProto(thisProto); + } + return false; + } + // If objGetPrototypeOf doesn't exist then just assume everything is ok. + return true; + } + /** + * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. + * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. + * @param target + * @param unknownValue + * @ignore + */ + function _getObjName(target, unknownValue) { + if ((0, ts_utils_1.objHasOwnProperty)(target, Prototype)) { + // Look like a prototype + return target.name || unknownValue || UnknownValue; + } + return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; + } + /** + * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- + * - Saves references to all defined base class functions + * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. + * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. + * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is + * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of + * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" + * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions + * defined in the constructor or some other function (rather than declared as complete typescript functions). + * ### Usage + * ```typescript + * import dynamicProto from "@microsoft/dynamicproto-js"; + * class ExampleClass extends BaseClass { + * constructor() { + * dynamicProto(ExampleClass, this, (_self, base) => { + * // This will define a function that will be converted to a prototype function + * _self.newFunc = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * ... + * } + * } + * // This will define a function that will be converted to a prototype function + * _self.myFunction = () => { + * // Access any "this" instance property + * if (_self.someProperty) { + * // Call the base version of the function that we are overriding + * base.myFunction(); + * } + * ... + * } + * _self.initialize = () => { + * ... + * } + * // Warnings: While the following will work as _self is simply a reference to + * // this, if anyone overrides myFunction() the overridden will be called first + * // as the normal JavaScript method resolution will occur and the defined + * // _self.initialize() function is actually gets removed from the instance and + * // a proxy prototype version is created to reference the created method. + * _self.initialize(); + * }); + * } + * } + * ``` + * @typeparam DPType This is the generic type of the class, used to keep intellisense valid + * @typeparam DPCls The type that contains the prototype of the current class + * @param theClass - This is the current class instance which contains the prototype for the current class + * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. + * @param delegateFunc - The callback function (closure) that will create the dynamic function + * @param options - Additional options to configure how the dynamic prototype operates + */ + function dynamicProto(theClass, target, delegateFunc, options) { + // Make sure that the passed theClass argument looks correct + if (!(0, ts_utils_1.objHasOwnProperty)(theClass, Prototype)) { + _throwTypeError("theClass is an invalid class definition."); + } + // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) + var classProto = theClass[Prototype]; + if (!_checkPrototype(classProto, target)) { + _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); + } + var className = null; + if ((0, ts_utils_1.objHasOwnProperty)(classProto, DynClassName)) { + // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) + className = classProto[DynClassName]; + } + else { + // As not all browser support name on the prototype creating a unique dynamic one if we have not already + // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance + // function table lookup. + className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; + _gblInst.n++; + try { + classProto[DynClassName] = className; + } + catch (e) { + // Ignore errors in restricted environments like Cloudflare Workers + } + } + var perfOptions = dynamicProto[DynProtoDefaultOptions]; + var useBaseInst = !!perfOptions[strUseBaseInst]; + if (useBaseInst && options && options[strUseBaseInst] !== undefined) { + useBaseInst = !!options[strUseBaseInst]; + } + // Get the current instance functions + var instFuncs = _getInstanceFuncs(target); + // Get all of the functions for any base instance (before they are potentially overridden) + var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); + // Execute the delegate passing in both the current target "this" and "base" function references + // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support + delegateFunc(target, baseFuncs); + // Don't allow setting instance functions in older browsers or restricted environments + var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isRestrictedEnvironment(); + if (setInstanceFunc && options) { + setInstanceFunc = !!options[strSetInstFuncs]; + } + // Populate the Prototype for any overridden instance functions + _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); + } + exports.default = dynamicProto; + /** + * Exposes the default global options to allow global configuration, if the global values are disabled these will override + * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose + * their internal usage of dynamic proto. + */ + dynamicProto[DynProtoDefaultOptions] = _gblInst.o; +}); +/// +define("test/DynamicProto.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoDefaultTests = void 0; + var InheritTest1 = /** @class */ (function () { + function InheritTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritTest1; + }()); + var InheritTest2 = /** @class */ (function (_super) { + __extends(InheritTest2, _super); + function InheritTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritTest2; + }(InheritTest1)); + var InheritTest3 = /** @class */ (function (_super) { + __extends(InheritTest3, _super); + function InheritTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritTest3; + }(InheritTest2)); + var DynInheritTest1 = /** @class */ (function () { + function DynInheritTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_1.default)(DynInheritTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }); + } + return DynInheritTest1; + }()); + var InheritTest4 = /** @class */ (function (_super) { + __extends(InheritTest4, _super); + function InheritTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritTest4; + }(DynInheritTest1)); + var InheritTest5 = /** @class */ (function (_super) { + __extends(InheritTest5, _super); + function InheritTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritTest5; + }(InheritTest4)); + var DynInheritTest2 = /** @class */ (function (_super) { + __extends(DynInheritTest2, _super); + function DynInheritTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_1.default)(DynInheritTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }); + return _this; + } + return DynInheritTest2; + }(InheritTest1)); + var DynInheritTest3 = /** @class */ (function (_super) { + __extends(DynInheritTest3, _super); + function DynInheritTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_1.default)(DynInheritTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }); + return _this; + } + return DynInheritTest3; + }(DynInheritTest2)); + var InheritTest6 = /** @class */ (function (_super) { + __extends(InheritTest6, _super); + function InheritTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritTest6; + }(DynInheritTest2)); + var DynInheritTest4 = /** @class */ (function (_super) { + __extends(DynInheritTest4, _super); + function DynInheritTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_1.default)(DynInheritTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }); + return _this; + } + return DynInheritTest4; + }(InheritTest6)); + var DynInheritTest5 = /** @class */ (function (_super) { + __extends(DynInheritTest5, _super); + function DynInheritTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_1.default)(DynInheritTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }); + return _this; + } + return DynInheritTest5; + }(DynInheritTest1)); + var DynInheritTest6 = /** @class */ (function (_super) { + __extends(DynInheritTest6, _super); + function DynInheritTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_1.default)(DynInheritTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }); + return _this; + } + return DynInheritTest6; + }(DynInheritTest5)); + var InstInherit1 = /** @class */ (function () { + function InstInherit1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInherit1; + }()); + var InstInherit2 = /** @class */ (function (_super) { + __extends(InstInherit2, _super); + function InstInherit2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInherit2; + }(InheritTest2)); + var InheritTest7 = /** @class */ (function (_super) { + __extends(InheritTest7, _super); + function InheritTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritTest7; + }(InstInherit1)); + var DynInheritTest7 = /** @class */ (function (_super) { + __extends(DynInheritTest7, _super); + function DynInheritTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_1.default)(DynInheritTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritTest7; + }(InstInherit1)); + var InstInherit3 = /** @class */ (function (_super) { + __extends(InstInherit3, _super); + function InstInherit3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInherit3; + }(DynInheritTest7)); + var DynInheritTest8 = /** @class */ (function (_super) { + __extends(DynInheritTest8, _super); + function DynInheritTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_1.default)(DynInheritTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }); + return _this; + } + return DynInheritTest8; + }(InstInherit3)); + var BadInstInherit1 = /** @class */ (function (_super) { + __extends(BadInstInherit1, _super); + function BadInstInherit1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInherit1; + }(InstInherit1)); + var DynInheritTest9 = /** @class */ (function (_super) { + __extends(DynInheritTest9, _super); + function DynInheritTest9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_1.default)(DynInheritTest9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }); + return _this; + } + return DynInheritTest9; + }(BadInstInherit1)); + var GoodInstInherit1 = /** @class */ (function (_super) { + __extends(GoodInstInherit1, _super); + function GoodInstInherit1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInherit1; + }(InstInherit1)); + var DynInheritTest10 = /** @class */ (function (_super) { + __extends(DynInheritTest10, _super); + function DynInheritTest10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_1.default)(DynInheritTest10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }); + return _this; + } + return DynInheritTest10; + }(GoodInstInherit1)); + var GoodInstInherit2 = /** @class */ (function (_super) { + __extends(GoodInstInherit2, _super); + function GoodInstInherit2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInherit2; + }(DynInheritTest10)); + var DynamicProtoDefaultTests = /** @class */ (function (_super) { + __extends(DynamicProtoDefaultTests, _super); + function DynamicProtoDefaultTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoDefaultTests.prototype.testInitialize = function () { + }; + DynamicProtoDefaultTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoDefaultTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoDefaultTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "Default: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritTest1(), [ + "InheritTest1()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInherit1(), [ + "InstInherit1()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInherit2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInherit3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInherit1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTest9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInherit1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTest10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInherit2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + ]); + } + }); + }; + return DynamicProtoDefaultTests; + }(TestClass)); + exports.DynamicProtoDefaultTests = DynamicProtoDefaultTests; +}); +/// +define("test/DynamicProtoMultipleCall.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoMultipleCallTests = void 0; + var InheritMultipleCallTest1 = /** @class */ (function () { + function InheritMultipleCallTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritMultipleCallTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritMultipleCallTest1; + }()); + var InheritMultipleCallTest2 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest2, _super); + function InheritMultipleCallTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritMultipleCallTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritMultipleCallTest2; + }(InheritMultipleCallTest1)); + var InheritMultipleCallTest3 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest3, _super); + function InheritMultipleCallTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritMultipleCallTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritMultipleCallTest3; + }(InheritMultipleCallTest2)); + var DynInheritMultipleCallTest1 = /** @class */ (function () { + function DynInheritMultipleCallTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }); + } + return DynInheritMultipleCallTest1; + }()); + var InheritMultipleCallTest4 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest4, _super); + function InheritMultipleCallTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritMultipleCallTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritMultipleCallTest4; + }(DynInheritMultipleCallTest1)); + var InheritMultipleCallTest5 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest5, _super); + function InheritMultipleCallTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritMultipleCallTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritMultipleCallTest5; + }(InheritMultipleCallTest4)); + var DynInheritMultipleCallTest2 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest2, _super); + function DynInheritMultipleCallTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest2; + }(InheritMultipleCallTest1)); + var DynInheritMultipleCallTest3 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest3, _super); + function DynInheritMultipleCallTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest3; + }(DynInheritMultipleCallTest2)); + var InheritMultipleCallTest6 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest6, _super); + function InheritMultipleCallTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritMultipleCallTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritMultipleCallTest6; + }(DynInheritMultipleCallTest2)); + var DynInheritMultipleCallTest4 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest4, _super); + function DynInheritMultipleCallTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest4; + }(InheritMultipleCallTest6)); + var DynInheritMultipleCallTest5 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest5, _super); + function DynInheritMultipleCallTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest5; + }(DynInheritMultipleCallTest1)); + var DynInheritMultipleCallTest6 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest6, _super); + function DynInheritMultipleCallTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest6; + }(DynInheritMultipleCallTest5)); + var InstInheritMultipleCall1 = /** @class */ (function () { + function InstInheritMultipleCall1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInheritMultipleCall1; + }()); + var InstInheritMultipleCall2 = /** @class */ (function (_super) { + __extends(InstInheritMultipleCall2, _super); + function InstInheritMultipleCall2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInheritMultipleCall2; + }(InheritMultipleCallTest2)); + var InheritMultipleCallTest7 = /** @class */ (function (_super) { + __extends(InheritMultipleCallTest7, _super); + function InheritMultipleCallTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritMultipleCallTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritMultipleCallTest7; + }(InstInheritMultipleCall1)); + var DynInheritMultipleCallTest7 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest7, _super); + function DynInheritMultipleCallTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest7; + }(InstInheritMultipleCall1)); + var InstInheritMultipleCall3 = /** @class */ (function (_super) { + __extends(InstInheritMultipleCall3, _super); + function InstInheritMultipleCall3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInheritMultipleCall3; + }(DynInheritMultipleCallTest7)); + var DynInheritMultipleCallTest8 = /** @class */ (function (_super) { + __extends(DynInheritMultipleCallTest8, _super); + function DynInheritMultipleCallTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_2.default)(DynInheritMultipleCallTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }); + return _this; + } + return DynInheritMultipleCallTest8; + }(InstInheritMultipleCall3)); + var BadInstInheritMultipleCall1 = /** @class */ (function (_super) { + __extends(BadInstInheritMultipleCall1, _super); + function BadInstInheritMultipleCall1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInheritMultipleCall1; + }(InstInheritMultipleCall1)); + var DynInheritTestMultipleCall9 = /** @class */ (function (_super) { + __extends(DynInheritTestMultipleCall9, _super); + function DynInheritTestMultipleCall9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_2.default)(DynInheritTestMultipleCall9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }); + return _this; + } + return DynInheritTestMultipleCall9; + }(BadInstInheritMultipleCall1)); + var GoodInstInheritMultipleCall1 = /** @class */ (function (_super) { + __extends(GoodInstInheritMultipleCall1, _super); + function GoodInstInheritMultipleCall1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInheritMultipleCall1; + }(InstInheritMultipleCall1)); + var DynInheritTestMultipleCall10 = /** @class */ (function (_super) { + __extends(DynInheritTestMultipleCall10, _super); + function DynInheritTestMultipleCall10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_2.default)(DynInheritTestMultipleCall10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }); + return _this; + } + return DynInheritTestMultipleCall10; + }(GoodInstInheritMultipleCall1)); + var GoodInstInheritMultipleCall2 = /** @class */ (function (_super) { + __extends(GoodInstInheritMultipleCall2, _super); + function GoodInstInheritMultipleCall2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInheritMultipleCall2; + }(DynInheritTestMultipleCall10)); + var DynamicProtoMultipleCallTests = /** @class */ (function (_super) { + __extends(DynamicProtoMultipleCallTests, _super); + function DynamicProtoMultipleCallTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoMultipleCallTests.prototype.testInitialize = function () { + }; + DynamicProtoMultipleCallTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoMultipleCallTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + theTest.testFunction(); + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoMultipleCallTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "MultipleCall: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritMultipleCallTest1(), [ + "InheritTest1()", + "InheritTest1.test()", + "InheritTest1.test()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritMultipleCallTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritMultipleCallTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritMultipleCallTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritMultipleCallTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritMultipleCallTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()", + "DynInheritTest1.test()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritMultipleCallTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritMultipleCallTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritMultipleCallTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritMultipleCallTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritMultipleCallTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritMultipleCallTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInheritMultipleCall1(), [ + "InstInherit1()", + "InstInherit1.test()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInheritMultipleCall2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritMultipleCallTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritMultipleCallTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInheritMultipleCall3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritMultipleCallTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInheritMultipleCall1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTestMultipleCall9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInheritMultipleCall1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTestMultipleCall10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInheritMultipleCall2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()" + ]); + } + }); + }; + return DynamicProtoMultipleCallTests; + }(TestClass)); + exports.DynamicProtoMultipleCallTests = DynamicProtoMultipleCallTests; +}); +/// +define("test/DynamicProtoNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_3) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoNoInstTests = void 0; + var InheritNoInstTest1 = /** @class */ (function () { + function InheritNoInstTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritNoInstTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritNoInstTest1; + }()); + var InheritNoInstTest2 = /** @class */ (function (_super) { + __extends(InheritNoInstTest2, _super); + function InheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritNoInstTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritNoInstTest2; + }(InheritNoInstTest1)); + var InheritNoInstTest3 = /** @class */ (function (_super) { + __extends(InheritNoInstTest3, _super); + function InheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritNoInstTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritNoInstTest3; + }(InheritNoInstTest2)); + var DynInheritNoInstTest1 = /** @class */ (function () { + function DynInheritNoInstTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }, { setInstFuncs: false }); + } + return DynInheritNoInstTest1; + }()); + var InheritNoInstTest4 = /** @class */ (function (_super) { + __extends(InheritNoInstTest4, _super); + function InheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritNoInstTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritNoInstTest4; + }(DynInheritNoInstTest1)); + var InheritNoInstTest5 = /** @class */ (function (_super) { + __extends(InheritNoInstTest5, _super); + function InheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritNoInstTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritNoInstTest5; + }(InheritNoInstTest4)); + var DynInheritNoInstTest2 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest2, _super); + function DynInheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest2; + }(InheritNoInstTest1)); + var DynInheritNoInstTest3 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest3, _super); + function DynInheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest3; + }(DynInheritNoInstTest2)); + var InheritNoInstTest6 = /** @class */ (function (_super) { + __extends(InheritNoInstTest6, _super); + function InheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritNoInstTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritNoInstTest6; + }(DynInheritNoInstTest2)); + var DynInheritNoInstTest4 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest4, _super); + function DynInheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest4; + }(InheritNoInstTest6)); + var DynInheritNoInstTest5 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest5, _super); + function DynInheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest5; + }(DynInheritNoInstTest1)); + var DynInheritNoInstTest6 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest6, _super); + function DynInheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest6; + }(DynInheritNoInstTest5)); + var InstInheritNoInst1 = /** @class */ (function () { + function InstInheritNoInst1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInheritNoInst1; + }()); + var InstInheritNoInst2 = /** @class */ (function (_super) { + __extends(InstInheritNoInst2, _super); + function InstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInheritNoInst2; + }(InheritNoInstTest2)); + var InheritNoInstTest7 = /** @class */ (function (_super) { + __extends(InheritNoInstTest7, _super); + function InheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritNoInstTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritNoInstTest7; + }(InstInheritNoInst1)); + var DynInheritNoInstTest7 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest7, _super); + function DynInheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritNoInstTest7; + }(InstInheritNoInst1)); + var InstInheritNoInst3 = /** @class */ (function (_super) { + __extends(InstInheritNoInst3, _super); + function InstInheritNoInst3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInheritNoInst3; + }(DynInheritNoInstTest7)); + var DynInheritNoInstTest8 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest8, _super); + function DynInheritNoInstTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_3.default)(DynInheritNoInstTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest8; + }(InstInheritNoInst3)); + var BadInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(BadInstInheritNoInst1, _super); + function BadInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst9 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst9, _super); + function DynInheritTestNoInst9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_3.default)(DynInheritTestNoInst9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst9; + }(BadInstInheritNoInst1)); + var GoodInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst1, _super); + function GoodInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst10 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst10, _super); + function DynInheritTestNoInst10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_3.default)(DynInheritTestNoInst10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst10; + }(GoodInstInheritNoInst1)); + var GoodInstInheritNoInst2 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst2, _super); + function GoodInstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInheritNoInst2; + }(DynInheritTestNoInst10)); + var DynamicProtoNoInstTests = /** @class */ (function (_super) { + __extends(DynamicProtoNoInstTests, _super); + function DynamicProtoNoInstTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoNoInstTests.prototype.testInitialize = function () { + }; + DynamicProtoNoInstTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoNoInstTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "NoInst: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritNoInstTest1(), [ + "InheritTest1()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritNoInstTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritNoInstTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritNoInstTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritNoInstTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritNoInstTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInheritNoInst1(), [ + "InstInherit1()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInheritNoInst2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritNoInstTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInheritNoInst3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + ]); + } + }); + }; + return DynamicProtoNoInstTests; + }(TestClass)); + exports.DynamicProtoNoInstTests = DynamicProtoNoInstTests; +}); +/// +define("test/DynamicProtoMultipleNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_4) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoMultipleNoInstTests = void 0; + var InheritNoInstTest1 = /** @class */ (function () { + function InheritNoInstTest1() { + this.executionOrder = []; + this.executionOrder.push("InheritTest1()"); + } + InheritNoInstTest1.prototype.testFunction = function () { + this.executionOrder.push("InheritTest1.test()"); + }; + return InheritNoInstTest1; + }()); + var InheritNoInstTest2 = /** @class */ (function (_super) { + __extends(InheritNoInstTest2, _super); + function InheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest2()"); + return _this; + } + InheritNoInstTest2.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest2.test()"); + }; + return InheritNoInstTest2; + }(InheritNoInstTest1)); + var InheritNoInstTest3 = /** @class */ (function (_super) { + __extends(InheritNoInstTest3, _super); + function InheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest3()"); + return _this; + } + InheritNoInstTest3.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest3.test()"); + }; + return InheritNoInstTest3; + }(InheritNoInstTest2)); + var DynInheritNoInstTest1 = /** @class */ (function () { + function DynInheritNoInstTest1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("DynInheritTest1()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest1, this, function (_self, base) { + _self.testFunction = function () { + _this.executionOrder.push("DynInheritTest1.test()"); + }; + }, { setInstFuncs: false }); + } + return DynInheritNoInstTest1; + }()); + var InheritNoInstTest4 = /** @class */ (function (_super) { + __extends(InheritNoInstTest4, _super); + function InheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest4()"); + return _this; + } + InheritNoInstTest4.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest4.test()"); + }; + return InheritNoInstTest4; + }(DynInheritNoInstTest1)); + var InheritNoInstTest5 = /** @class */ (function (_super) { + __extends(InheritNoInstTest5, _super); + function InheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest5()"); + return _this; + } + InheritNoInstTest5.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest5.test()"); + }; + return InheritNoInstTest5; + }(InheritNoInstTest4)); + var DynInheritNoInstTest2 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest2, _super); + function DynInheritNoInstTest2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest2()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest2, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest2.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest2; + }(InheritNoInstTest1)); + var DynInheritNoInstTest3 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest3, _super); + function DynInheritNoInstTest3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest3()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest3, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest3.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest3; + }(DynInheritNoInstTest2)); + var InheritNoInstTest6 = /** @class */ (function (_super) { + __extends(InheritNoInstTest6, _super); + function InheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest6()"); + return _this; + } + InheritNoInstTest6.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest6.test()"); + }; + return InheritNoInstTest6; + }(DynInheritNoInstTest2)); + var DynInheritNoInstTest4 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest4, _super); + function DynInheritNoInstTest4() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest4()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest4, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest4.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest4; + }(InheritNoInstTest6)); + var DynInheritNoInstTest5 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest5, _super); + function DynInheritNoInstTest5() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest5()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest5, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest5.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest5; + }(DynInheritNoInstTest1)); + var DynInheritNoInstTest6 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest6, _super); + function DynInheritNoInstTest6() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest6()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest6, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest6.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest6; + }(DynInheritNoInstTest5)); + var InstInheritNoInst1 = /** @class */ (function () { + function InstInheritNoInst1() { + var _this = this; + this.executionOrder = []; + this.executionOrder.push("InstInherit1()"); + this.testFunction = function () { + _this.executionOrder.push("InstInherit1.test()"); + }; + } + return InstInheritNoInst1; + }()); + var InstInheritNoInst2 = /** @class */ (function (_super) { + __extends(InstInheritNoInst2, _super); + function InstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit2()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit2.test()"); + }; + return _this; + } + return InstInheritNoInst2; + }(InheritNoInstTest2)); + var InheritNoInstTest7 = /** @class */ (function (_super) { + __extends(InheritNoInstTest7, _super); + function InheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InheritTest7()"); + return _this; + } + InheritNoInstTest7.prototype.testFunction = function () { + _super.prototype.testFunction.call(this); + this.executionOrder.push("InheritTest7.test()"); + }; + return InheritNoInstTest7; + }(InstInheritNoInst1)); + var DynInheritNoInstTest7 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest7, _super); + function DynInheritNoInstTest7() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest7()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest7, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest7.test()"); + }; + }); + return _this; + } + return DynInheritNoInstTest7; + }(InstInheritNoInst1)); + var InstInheritNoInst3 = /** @class */ (function (_super) { + __extends(InstInheritNoInst3, _super); + function InstInheritNoInst3() { + var _this = _super.call(this) || this; + _this.executionOrder.push("InstInherit3()"); + _this.testFunction = function () { + _super.prototype.testFunction.call(_this); + _this.executionOrder.push("InstInherit3.test()"); + }; + return _this; + } + return InstInheritNoInst3; + }(DynInheritNoInstTest7)); + var DynInheritNoInstTest8 = /** @class */ (function (_super) { + __extends(DynInheritNoInstTest8, _super); + function DynInheritNoInstTest8() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest8()"); + (0, DynamicProto_4.default)(DynInheritNoInstTest8, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest8.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritNoInstTest8; + }(InstInheritNoInst3)); + var BadInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(BadInstInheritNoInst1, _super); + function BadInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("BadInstInherit1()"); + _this.testFunction = function () { + try { + _super.prototype.testFunction.call(_this); + } + catch (e) { + _this.executionOrder.push("BadInstInherit1.throw()"); + } + _this.executionOrder.push("BadInstInherit1.test()"); + }; + return _this; + } + return BadInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst9 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst9, _super); + function DynInheritTestNoInst9() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest9()"); + (0, DynamicProto_4.default)(DynInheritTestNoInst9, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest9.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst9; + }(BadInstInheritNoInst1)); + var GoodInstInheritNoInst1 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst1, _super); + function GoodInstInheritNoInst1() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit1()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit1.test()"); + }; + return _this; + } + return GoodInstInheritNoInst1; + }(InstInheritNoInst1)); + var DynInheritTestNoInst10 = /** @class */ (function (_super) { + __extends(DynInheritTestNoInst10, _super); + function DynInheritTestNoInst10() { + var _this = _super.call(this) || this; + _this.executionOrder.push("DynInheritTest10()"); + (0, DynamicProto_4.default)(DynInheritTestNoInst10, _this, function (_self, base) { + _self.testFunction = function () { + base.testFunction(); + _this.executionOrder.push("DynInheritTest10.test()"); + }; + }, { setInstFuncs: false }); + return _this; + } + return DynInheritTestNoInst10; + }(GoodInstInheritNoInst1)); + var GoodInstInheritNoInst2 = /** @class */ (function (_super) { + __extends(GoodInstInheritNoInst2, _super); + function GoodInstInheritNoInst2() { + var _this = _super.call(this) || this; + _this.executionOrder.push("GoodInstInherit2()"); + var prevTestFunc = _this.testFunction; + _this.testFunction = function () { + prevTestFunc.call(_this); + _this.executionOrder.push("GoodInstInherit2.test()"); + }; + return _this; + } + return GoodInstInheritNoInst2; + }(DynInheritTestNoInst10)); + var DynamicProtoMultipleNoInstTests = /** @class */ (function (_super) { + __extends(DynamicProtoMultipleNoInstTests, _super); + function DynamicProtoMultipleNoInstTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoMultipleNoInstTests.prototype.testInitialize = function () { + }; + DynamicProtoMultipleNoInstTests.prototype._validateOrder = function (message, actual, expected) { + QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); + var passed = true; + var error = ""; + for (var lp = 0; lp < expected.length; lp++) { + if (lp < actual.length) { + if (actual[lp] !== expected[lp]) { + passed = false; + error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; + } + else { + error += " " + expected[lp] + ";"; + } + } + else { + passed = false; + error += " --[" + expected[lp] + "]--;"; + } + } + // Fail test and log any extra unexpected calls + for (var lp = expected.length; lp < actual.length; lp++) { + passed = false; + error += " ++[" + actual[lp] + "]++;"; + } + QUnit.assert.ok(passed, message + ":" + error); + }; + DynamicProtoMultipleNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { + theTest.testFunction(); + theTest.testFunction(); + this._validateOrder(message, theTest.executionOrder, expectedOrder); + }; + DynamicProtoMultipleNoInstTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "NoInst: Inheritance tests", + test: function () { + _this.doTest("InheritTest1", new InheritNoInstTest1(), [ + "InheritTest1()", + "InheritTest1.test()", + "InheritTest1.test()" + ]); + _this.doTest("InheritTest2", new InheritNoInstTest2(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest1.test()", + "InheritTest2.test()" + ]); + _this.doTest("InheritTest3", new InheritNoInstTest3(), [ + "InheritTest1()", + "InheritTest2()", + "InheritTest3()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InheritTest3.test()" + ]); + _this.doTest("InheritTest4", new InheritNoInstTest4(), [ + "DynInheritTest1()", + "InheritTest4()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "DynInheritTest1.test()", + "InheritTest4.test()" + ]); + _this.doTest("InheritTest5", new InheritNoInstTest5(), [ + "DynInheritTest1()", + "InheritTest4()", + "InheritTest5()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()", + "DynInheritTest1.test()", + "InheritTest4.test()", + "InheritTest5.test()" + ]); + _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ + "DynInheritTest1()", + "DynInheritTest1.test()", + "DynInheritTest1.test()" + ]); + _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest1.test()", + "DynInheritTest2.test()" + ]); + _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ + "InheritTest1()", + "DynInheritTest2()", + "DynInheritTest3()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "DynInheritTest3.test()" + ]); + _this.doTest("InheritTest6", new InheritNoInstTest6(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()" + ]); + _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ + "InheritTest1()", + "DynInheritTest2()", + "InheritTest6()", + "DynInheritTest4()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()", + "InheritTest1.test()", + "DynInheritTest2.test()", + "InheritTest6.test()", + "DynInheritTest4.test()" + ]); + _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()" + ]); + _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ + "DynInheritTest1()", + "DynInheritTest5()", + "DynInheritTest6()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()", + "DynInheritTest1.test()", + "DynInheritTest5.test()", + "DynInheritTest6.test()" + ]); + _this.doTest("InstInherit1", new InstInheritNoInst1(), [ + "InstInherit1()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + _this.doTest("InstInherit2", new InstInheritNoInst2(), [ + "InheritTest1()", + "InheritTest2()", + "InstInherit2()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()", + "InheritTest1.test()", + "InheritTest2.test()", + "InstInherit2.test()" + ]); + // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this + _this.doTest("InheritTest7", new InheritNoInstTest7(), [ + "InstInherit1()", + "InheritTest7()", + "InstInherit1.test()", + "InstInherit1.test()" + ]); + // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario + _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit1.test()", + "DynInheritTest7.test()" + ]); + _this.doTest("InstInherit3", new InstInheritNoInst3(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()" + ]); + _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ + "InstInherit1()", + "DynInheritTest7()", + "InstInherit3()", + "DynInheritTest8()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()", + "InstInherit1.test()", + "DynInheritTest7.test()", + "InstInherit3.test()", + "DynInheritTest8.test()" + ]); + // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case + _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ + "InstInherit1()", + "BadInstInherit1()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()" + ]); + // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order + _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ + "InstInherit1()", + "BadInstInherit1()", + "DynInheritTest9()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()", + "BadInstInherit1.throw()", + "BadInstInherit1.test()", + "DynInheritTest9.test()" + ]); + _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ + "InstInherit1()", + "GoodInstInherit1()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()" + ]); + _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()" + ]); + _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ + "InstInherit1()", + "GoodInstInherit1()", + "DynInheritTest10()", + "GoodInstInherit2()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()", + "InstInherit1.test()", + "GoodInstInherit1.test()", + "DynInheritTest10.test()", + "GoodInstInherit2.test()" + ]); + } + }); + }; + return DynamicProtoMultipleNoInstTests; + }(TestClass)); + exports.DynamicProtoMultipleNoInstTests = DynamicProtoMultipleNoInstTests; +}); +/// +define("test/SecurityCheck.Tests", ["require", "exports", "@nevware21/ts-utils", "src/DynamicProto"], function (require, exports, ts_utils_2, DynamicProto_5) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SecurityCheckTests = void 0; + var HackClass = /** @class */ (function () { + function HackClass() { + this.hello = "world"; + } + return HackClass; + }()); + var BadInstClass = /** @class */ (function () { + function BadInstClass() { + this._dynInstFuncs = {}; + this._dynInstFuncs = Object.prototype; + } + return BadInstClass; + }()); + var BadProxyInstClass = /** @class */ (function () { + function BadProxyInstClass() { + this._dynInstFuncs = {}; + this._dynInstFuncs = new Proxy(this, { + get: function (target, prop) { + if (typeof prop === "string" && prop.startsWith("_dynCls")) { + return Object.prototype; + } + return target[prop]; + } + }); + } + return BadProxyInstClass; + }()); + var SecurityCheckTests = /** @class */ (function (_super) { + __extends(SecurityCheckTests, _super); + function SecurityCheckTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + SecurityCheckTests.prototype.testInitialize = function () { + }; + SecurityCheckTests.prototype.registerTests = function () { + this.testCase({ + name: "Try to update Object.prototype directly", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(Object, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(Object.prototype, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(Object, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with a HackClass instance and __proto__ property", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self.__proto__ = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with a HackClass instance and __proto__ function", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self.__proto__ = function () { + testHack: true; + }; + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + Object.defineProperty(self, "__proto__", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + Object.defineProperty(self, "__proto__", { + value: function () { + testHack: true; + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype using HackClass instance with a __proto__ function", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self.__proto__ = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self.prototype = { + testHack2: true + }; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with HackClass and an object instance", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self.__proto__ = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance", + test: function () { + var a = {}; + try { + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + Object.defineProperty(self, "__proto__", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + }); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self["__proto__['hacked']"] = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + Object.defineProperty(self, "__proto__['hacked']", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype directly with a HackClass instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + self.__proto__ = { + testHack: true + }; + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly using defineProperty with a HackClass instance", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var self = _self; + self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + Object.defineProperty(self, "__proto__", { + value: { + testHack: true + }, + configurable: true, + enumerable: true + }); + self.prototype = { + testHack2: true + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly with a null prototype instance", + test: function () { + var a = {}; + var theInstance = Object.create(a); + try { + (0, DynamicProto_5.default)(theInstance, a, function (_self, base) { + _self.__proto__ = { + testHack: true + }; + _self.prototype = { + testHack2: true + }; + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly with an a prototype instance", + test: function () { + var a = {}; + var theInstance = Object.create(a); + try { + (0, DynamicProto_5.default)(Object.getPrototypeOf(theInstance), a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { + get: function (target, prop) { + if (typeof prop === "string" && prop.startsWith("_dynCls")) { + return Object.prototype; + } + return target[prop]; + } + }); + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var className = _self["_dynClass"]; + var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); + // Change the return class prototype to be Object.prototype + classProto["_dynCls" + className] = Object.prototype; + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + try { + (0, ts_utils_2.objGetPrototypeOf)(base).testHack = true; + QUnit.assert.fail("Should not be able to update Object.prototype"); + } + catch (e) { + QUnit.assert.ok(true, "Expected an exception to be thrown"); + } + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { + get: function (target, prop) { + if (typeof prop === "string" && prop.startsWith("_dynCls")) { + return Array.prototype; + } + return target[prop]; + } + }); + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Array.prototype"); + }; + }); + QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); + } + }); + this.testCase({ + name: "Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", + test: function () { + var a = new HackClass(); + (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { + var className = _self["_dynClass"]; + var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); + // Change the return class prototype to be Object.prototype + classProto["_dynCls" + className] = Array.prototype; + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Array.prototype"); + }; + }); + QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype with a BadInstClass instance", + test: function () { + var a = new BadInstClass(); + (0, DynamicProto_5.default)(BadInstClass, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); + } + }); + this.testCase({ + name: "Try to update Object.prototype with a BadProxyInstClass instance", + test: function () { + var a = new BadProxyInstClass(); + (0, DynamicProto_5.default)(BadProxyInstClass, a, function (_self, base) { + _self._testFunction = function () { + QUnit.assert.fail("Should not be able to update Object.prototype"); + }; + }); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); + QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); + } + }); + }; + return SecurityCheckTests; + }(TestClass)); + exports.SecurityCheckTests = SecurityCheckTests; +}); +define("test/Selenium/DynamicProtoTests", ["require", "exports", "test/DynamicProto.Tests", "test/DynamicProtoMultipleCall.Tests", "test/DynamicProtoNoInst.Tests", "test/DynamicProtoMultipleNoInst.Tests", "test/SecurityCheck.Tests"], function (require, exports, DynamicProto_Tests_1, DynamicProtoMultipleCall_Tests_1, DynamicProtoNoInst_Tests_1, DynamicProtoMultipleNoInst_Tests_1, SecurityCheck_Tests_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.runTests = void 0; + function runTests() { + new DynamicProto_Tests_1.DynamicProtoDefaultTests("Default").registerTests(); + new DynamicProtoMultipleCall_Tests_1.DynamicProtoMultipleCallTests("Multiple").registerTests(); + new DynamicProtoNoInst_Tests_1.DynamicProtoNoInstTests("SetInst").registerTests(); + new DynamicProtoMultipleNoInst_Tests_1.DynamicProtoMultipleNoInstTests("Multiple SetInst").registerTests(); + new SecurityCheck_Tests_1.SecurityCheckTests("Security Checks").registerTests(); + } + exports.runTests = runTests; +}); +//# sourceMappingURL=dynamicprototests.js.map \ No newline at end of file diff --git a/lib/test/Selenium/dynamicprototests.js.map b/lib/test/Selenium/dynamicprototests.js.map new file mode 100644 index 0000000..b3a74e7 --- /dev/null +++ b/lib/test/Selenium/dynamicprototests.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicprototests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/DynamicProto.ts","../DynamicProto.Tests.ts","../DynamicProtoMultipleCall.Tests.ts","../DynamicProtoNoInst.Tests.ts","../DynamicProtoMultipleNoInst.Tests.ts","../SecurityCheck.Tests.ts","DynamicProtoTests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA+C;AAE/C;;;;GAIG;AACH;IAAA;IA2IA,CAAC;IA1IE;;;;;;;;;;;OAWG;IACY,gBAAS,GAAvB,UAAwB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAChE,OAAO,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,YAAK,GAAnB,UAAoB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAC5D,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,mBAAY,GAA1B,UAA2B,QAAa,EAAE,MAAW,EAAE,OAAgB;QACnE,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAEF;;;;;;;;;;;OAWG;IACY,eAAQ,GAAtB,UAAuB,QAAa,EAAE,MAAW,EAAE,OAAgB;QAC/D,OAAO,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEa,mBAAY,GAA1B,UAA2B,QAAa,EAAE,MAAW,EAAE,OAAgB;QACnE,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAEa,gBAAS,GAAvB,UAAwB,QAAa,EAAE,MAAW,EAAE,OAAgB;QACh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Q;QACpB,IAAI,6CAAwB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;QACxD,IAAI,8DAA6B,CAAC,UAAU,CAAC,CAAC,aAAa,EAAE,CAAC;QAC9D,IAAI,kDAAuB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC;QACvD,IAAI,kEAA+B,CAAC,kBAAkB,CAAC,CAAC,aAAa,EAAE,CAAC;QACxE,IAAI,wCAAkB,CAAC,iBAAiB,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9D,CAAC;IAND,4BAMC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\n\ninterface DynamicGlobalSettings {\n /**\n * Stores the global options which will also be exposed on the runtime global\n */\n o: IDynamicProtoOpts,\n\n /**\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\n * @ignore\n */ \n n: number\n};\n\n\n\n/**\n * Helper to check if we're running in a restricted environment that doesn't support\n * property redefinition, like Cloudflare Workers. This is primarily used to avoid\n * operations that would cause issues in these environments.\n * @ignore\n */\nfunction _isRestrictedEnvironment(): boolean {\n try {\n // Test if we can perform property definition/redefinition\n // This specifically targets restricted environments like Cloudflare Workers\n // where property redefinition causes errors\n let testObj = {};\n let testProp = \"testProperty\";\n Object.defineProperty(testObj, testProp, { \n configurable: true,\n value: 1\n });\n Object.defineProperty(testObj, testProp, {\n configurable: true,\n value: 2\n });\n \n // If we can redefine properties, not a restricted environment\n return false;\n } catch (e) {\n // If property redefinition fails, we're in a restricted environment\n return true;\n }\n}\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Constructor = 'constructor';\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Prototype = 'prototype';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strFunction = 'function';\n\n/**\n * Used to define the name of the instance function lookup table\n * @ignore\n */ \nconst DynInstFuncTable = '_dynInstFuncs';\n \n/**\n * Name used to tag the dynamic prototype function\n * @ignore\n */ \nconst DynProxyTag = '_isDynProxy';\n \n/**\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\n * @ignore\n */ \nconst DynClassName = '_dynClass';\n \n/**\n * Prefix added to the classname to avoid any name clashes with other instance level properties\n * @ignore\n */ \nconst DynClassNamePrefix = '_dynCls$';\n \n/**\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\n * @ignore\n */\nconst DynInstChkTag = '_dynInstChk';\n \n/**\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same \n * tag name as the function level but a different const name for readability only.\n */\nconst DynAllowInstChkTag = DynInstChkTag;\n \n/**\n * The global (imported) instances where the global performance options are stored\n */\nconst DynProtoDefaultOptions = '_dfOpts';\n \n/**\n * Value used as the name of a class when it cannot be determined\n * @ignore\n */ \nconst UnknownValue = '_unknown_';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst str__Proto = \"__proto__\";\n \n/**\n * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\n */\nconst DynProtoBaseProto = \"_dyn\" + str__Proto;\n\n/**\n * Runtime Global holder for dynamicProto settings\n */\nconst DynProtoGlobalSettings = \"__dynProto$Gbl\";\n\n/**\n * Track the current prototype for IE8 as you can't look back to get the prototype\n */\nconst DynProtoCurrent = \"_dynInstProto\";\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strUseBaseInst = 'useBaseInst';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strSetInstFuncs = 'setInstFuncs';\n \nconst Obj = Object;\n\n/**\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\n * @ignore\n */\nlet _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\n\n/**\n * Pre-lookup to check for the existence of this function\n */\nlet _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\n\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\nlet _gbl = getGlobal();\nlet _gblInst: DynamicGlobalSettings = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\n o: {\n [strSetInstFuncs]: true,\n [strUseBaseInst]: true\n },\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\n});\n\n/**\n * Helper used to check whether the target is an Object prototype or Array prototype\n * @ignore\n */ \nfunction _isObjectOrArrayPrototype(target:any) {\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\n}\n\n/**\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\n * @ignore\n */ \nfunction _isObjectArrayOrFunctionPrototype(target:any) {\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\n}\n\n/**\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\n * @ignore\n */ \nfunction _getObjProto(target:any) {\n let newProto;\n\n if (target) {\n // This method doesn't exist in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n return _objGetPrototypeOf(target);\n }\n\n let curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\n\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\n newProto = target[DynProtoBaseProto] || curProto;\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\n target[DynProtoCurrent] = curProto;\n }\n }\n\n return newProto;\n}\n\n/**\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\n * are not enumerable.\n * @param target \n */\nfunction _forEachProp(target: any, func: (name: string) => void) {\n let props: string[] = [];\n if (_objGetOwnProps) {\n props = _objGetOwnProps(target);\n } else {\n for (let name in target) {\n if (typeof name === \"string\" && objHasOwnProperty(target, name)) {\n props.push(name);\n }\n }\n }\n\n if (props && props.length > 0) {\n for (let lp = 0; lp < props.length; lp++) {\n func(props[lp]);\n }\n }\n}\n\n/**\n * Helper function to check whether the provided function name is a potential candidate for dynamic\n * callback and prototype generation.\n * @param target The target object, may be a prototype or class object\n * @param funcName The function name\n * @param skipOwn Skips the check for own property\n * @ignore\n */\nfunction _isDynamicCandidate(target:any, funcName:string, skipOwn:boolean) {\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);\n}\n\n/**\n * Helper to throw a TypeError exception\n * @param message the message\n * @ignore\n */\nfunction _throwTypeError(message:string) {\n throwTypeError(\"DynamicProto: \" + message);\n}\n\n/**\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does \n * not return any inherited functions\n * @param thisTarget The object to get the instance functions from\n * @ignore\n */\nfunction _getInstanceFuncs(thisTarget:any): any {\n // Get the base proto\n var instFuncs = objCreate(null);\n\n // Save any existing instance functions\n _forEachProp(thisTarget, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\n // Create an instance callback for passing the base function to the caller\n instFuncs[name] = thisTarget[name];\n }\n });\n\n return instFuncs;\n}\n\n/**\n * Returns whether the value is included in the array\n * @param values The array of values\n * @param value The value\n */\nfunction _hasVisited(values:any[], value:any) {\n for (let lp = values.length - 1; lp >= 0; lp--) {\n if (values[lp] === value) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\n * @param target The current instance\n * @ignore\n */\nfunction _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseInst:boolean): any {\n function _instFuncProxy(target:any, funcHost: any, funcName: string) {\n let theFunc = funcHost[funcName];\n if (theFunc[DynProxyTag] && useBaseInst) {\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\n let instFuncTable = target[DynInstFuncTable] || {};\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\n }\n }\n\n return function() {\n // eslint-disable-next-line prefer-rest-params\n return theFunc.apply(target, arguments);\n };\n }\n\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\n var baseFuncs = objCreate(null);\n _forEachProp(instFuncs, (name) => {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\n });\n \n // Get the base prototype functions\n var baseProto = _getObjProto(classProto);\n let visited:any[] = [];\n\n // Don't include base object functions for Object, Array or Function\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\n // look for prototype functions\n _forEachProp(baseProto, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\n // the Object prototype methods while bypassing the check\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\n }\n });\n\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(baseProto);\n baseProto = _getObjProto(baseProto);\n }\n\n return baseFuncs;\n}\n\nfunction _getInstFunc(target: any, funcName: string, proto: any, currentDynProtoProxy: any) {\n let instFunc = null;\n\n // We need to check whether the class name is defined directly on this prototype otherwise\n // it will walk the proto chain and return any parent proto classname.\n if (target && objHasOwnProperty(proto, DynClassName)) {\n\n let instFuncTable = target[DynInstFuncTable] || objCreate(null);\n instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[funcName];\n\n if (!instFunc) {\n // Avoid stack overflow from recursive calling the same function\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\n }\n\n // We have the instance function, lets check it we can speed up further calls\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\n // If the instance already has an instance function we can't replace it\n let canAddInst = !objHasOwnProperty(target, funcName);\n\n // Get current prototype\n let objProto = _getObjProto(target);\n let visited:any[] = [];\n\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\n let protoFunc = objProto[funcName];\n if (protoFunc) {\n canAddInst = (protoFunc === currentDynProtoProxy);\n break;\n }\n\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\n visited.push(objProto);\n objProto = _getObjProto(objProto);\n }\n\n try {\n if (canAddInst) {\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\n // so it's safe to directly assign for any subsequent calls (for better performance)\n target[funcName] = instFunc;\n }\n\n // Block further attempts to set the instance function for any\n instFunc[DynInstChkTag] = 1;\n } catch (e) {\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\n // And set a flag so we don't try again for any function\n instFuncTable[DynAllowInstChkTag] = false;\n }\n }\n }\n\n return instFunc;\n}\n\nfunction _getProtoFunc(funcName: string, proto: any, currentDynProtoProxy: any) {\n let protoFunc = proto[funcName];\n\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\n if (protoFunc === currentDynProtoProxy) {\n // It is so lookup the base prototype\n protoFunc = _getObjProto(proto)[funcName];\n }\n\n if (typeof protoFunc !== strFunction) {\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\n }\n\n return protoFunc;\n}\n\n/**\n * Add the required dynamic prototype methods to the the class prototype\n * @param proto - The class prototype\n * @param className - The instance classname \n * @param target - The target instance\n * @param baseInstFuncs - The base instance functions\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\n * @ignore\n */\nfunction _populatePrototype(proto:any, className:string, target:any, baseInstFuncs:any, setInstanceFunc:boolean) {\n function _createDynamicPrototype(proto:any, funcName:string) {\n let dynProtoProxy = function() {\n // Use the instance or prototype function\n let instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\n // eslint-disable-next-line prefer-rest-params\n return instFunc.apply(this, arguments);\n };\n \n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\n // via which can dynamically replace the prototype function reference)\n try {\n (dynProtoProxy as any)[DynProxyTag] = 1;\n } catch (e) {\n // Ignore errors in restricted environments like Cloudflare Workers\n }\n return dynProtoProxy;\n }\n \n if (!_isObjectOrArrayPrototype(proto)) {\n let instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);\n if (!_isObjectOrArrayPrototype(instFuncTable)) {\n let instFuncs = instFuncTable[className] = (instFuncTable[className] || objCreate(null)); // fetch and assign if as it may not exist yet\n\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\n }\n\n if (!_isObjectOrArrayPrototype(instFuncs)) {\n _forEachProp(target, (name) => {\n // Only add overridden functions\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name] ) {\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\n instFuncs[name] = target[name];\n try {\n delete target[name];\n } catch (e) {\n // Ignore errors in restricted environments like Cloudflare Workers\n }\n \n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\n if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\n proto[name] = _createDynamicPrototype(proto, name);\n }\n }\n });\n }\n }\n }\n}\n\n/**\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\n * @param classProto The class prototype instance\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\n * @ignore\n */\nfunction _checkPrototype(classProto:any, thisTarget:any) {\n // This method doesn't existing in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\n let visited:any[] = [];\n let thisProto = _getObjProto(thisTarget);\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\n if (thisProto === classProto) {\n return true;\n }\n\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(thisProto);\n thisProto = _getObjProto(thisProto);\n }\n\n return false;\n }\n\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\n return true;\n}\n\n/**\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\n * @param target \n * @param unknownValue \n * @ignore\n */\nfunction _getObjName(target:any, unknownValue?:string) {\n if (objHasOwnProperty(target, Prototype)) {\n // Look like a prototype\n return target.name || unknownValue || UnknownValue\n }\n\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\n}\n\n/**\n * Interface to define additional configuration options to control how the dynamic prototype functions operate.\n */\nexport interface IDynamicProtoOpts {\n\n /**\n * Should the dynamic prototype attempt to set an instance function for instances that do not already have an\n * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function.\n */\n setInstFuncs: boolean,\n\n /**\n * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions\n * and bypass the prototype lookups. Defaults to true.\n */\n useBaseInst?: boolean\n}\n\n/**\n * The delegate signature for the function used as the callback for dynamicProto() \n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even \n * though it is only a proxy that only contains the functions \n * @param theTarget This is the real \"this\" of the current target object\n * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the \"this\" instance before\n * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the \"super\" keyword.\n */\nexport type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPType) => void;\n\n/**\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\n * - Saves references to all defined base class functions\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is \n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\n * ### Usage\n * ```typescript\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\n * class ExampleClass extends BaseClass {\n * constructor() {\n * dynamicProto(ExampleClass, this, (_self, base) => {\n * // This will define a function that will be converted to a prototype function\n * _self.newFunc = () => {\n * // Access any \"this\" instance property \n * if (_self.someProperty) {\n * ...\n * }\n * }\n * // This will define a function that will be converted to a prototype function\n * _self.myFunction = () => {\n * // Access any \"this\" instance property\n * if (_self.someProperty) {\n * // Call the base version of the function that we are overriding\n * base.myFunction();\n * }\n * ...\n * }\n * _self.initialize = () => {\n * ...\n * }\n * // Warnings: While the following will work as _self is simply a reference to\n * // this, if anyone overrides myFunction() the overridden will be called first\n * // as the normal JavaScript method resolution will occur and the defined\n * // _self.initialize() function is actually gets removed from the instance and\n * // a proxy prototype version is created to reference the created method.\n * _self.initialize();\n * });\n * }\n * }\n * ```\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\n * @typeparam DPCls The type that contains the prototype of the current class\n * @param theClass - This is the current class instance which contains the prototype for the current class\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\n * @param options - Additional options to configure how the dynamic prototype operates\n */\nexport default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void {\n // Make sure that the passed theClass argument looks correct\n if (!objHasOwnProperty(theClass, Prototype)) {\n _throwTypeError(\"theClass is an invalid class definition.\");\n }\n\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\n let classProto = theClass[Prototype];\n if (!_checkPrototype(classProto, target)) {\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\n }\n\n let className = null;\n if (objHasOwnProperty(classProto, DynClassName)) {\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\n className = classProto[DynClassName];\n } else {\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\n // function table lookup.\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _gblInst.n ;\n _gblInst.n++;\n try {\n classProto[DynClassName] = className;\n } catch (e) {\n // Ignore errors in restricted environments like Cloudflare Workers\n }\n }\n\n let perfOptions = dynamicProto[DynProtoDefaultOptions];\n let useBaseInst = !!perfOptions[strUseBaseInst];\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\n useBaseInst = !!options[strUseBaseInst];\n }\n\n // Get the current instance functions\n let instFuncs = _getInstanceFuncs(target);\n\n // Get all of the functions for any base instance (before they are potentially overridden)\n let baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\n\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\n delegateFunc(target, baseFuncs as DPType);\n\n // Don't allow setting instance functions in older browsers or restricted environments\n let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isRestrictedEnvironment();\n if (setInstanceFunc && options) {\n setInstanceFunc = !!options[strSetInstFuncs];\n }\n\n // Populate the Prototype for any overridden instance functions\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\n}\n\n/**\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\n * their internal usage of dynamic proto.\n */\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritTest3 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritTest4 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritTest5 extends InheritTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest3 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritTest6 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritTest4 extends InheritTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest5 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest6 extends DynInheritTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInherit1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInherit2 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInherit3 extends DynInheritTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritTest8 extends InstInherit3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest9 extends BadInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTest9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest10 extends GoodInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTest10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit2 extends DynInheritTest10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoDefaultTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"Default: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInherit1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInherit2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInherit3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInherit1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTest9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInherit1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTest10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInherit2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritMultipleCallTest3 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritMultipleCallTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest4 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritMultipleCallTest5 extends InheritMultipleCallTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritMultipleCallTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest3 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritMultipleCallTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest6 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest4 extends InheritMultipleCallTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritMultipleCallTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest5 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritMultipleCallTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest6 extends DynInheritMultipleCallTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritMultipleCallTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritMultipleCall2 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritMultipleCallTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall3 extends DynInheritMultipleCallTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritMultipleCallTest8 extends InstInheritMultipleCall3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritMultipleCallTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall9 extends BadInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestMultipleCall9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall10 extends GoodInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestMultipleCall10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall2 extends DynInheritTestMultipleCall10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleCallTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"MultipleCall: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritMultipleCallTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritMultipleCallTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritMultipleCallTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritMultipleCallTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritMultipleCallTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritMultipleCallTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritMultipleCall2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritMultipleCallTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritMultipleCallTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritMultipleCall3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritMultipleCallTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestMultipleCall9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestMultipleCall10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritMultipleCall2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport { objGetPrototypeOf } from \"@nevware21/ts-utils\";\nimport dynamicProto from \"../src/DynamicProto\";\n\nclass HackClass {\n public hello: string;\n\n constructor() {\n this.hello = \"world\";\n }\n}\n\n\nclass BadInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = Object.prototype;\n }\n}\n\nclass BadProxyInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = new Proxy(this, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n }\n}\n\nexport class SecurityCheckTests extends TestClass {\n\n public testInitialize() {\n }\n\n public registerTests() {\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object.prototype, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = () => {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: () => {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype using HackClass instance with a __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n self.__proto__ = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n self.__proto__ = {\n testHack: true\n };\n \n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n \n self.prototype = {\n testHack2: true\n };\n });\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self[\"__proto__['hacked']\"] = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__['hacked']\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance\",\n test: () => {\n let a = new HackClass()\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with a HackClass instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with a null prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n\n try {\n dynamicProto(theInstance, a, (_self, base) => {\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with an a prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n try {\n dynamicProto(Object.getPrototypeOf(theInstance), a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Object.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n try {\n objGetPrototypeOf(base).testHack = true;\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Array.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Array.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadInstClass instance\",\n test: () => {\n let a = new BadInstClass();\n\n dynamicProto(BadInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadProxyInstClass instance\",\n test: () => {\n let a = new BadProxyInstClass();\n\n dynamicProto(BadProxyInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n }\n}\n\n","import { DynamicProtoDefaultTests } from '../DynamicProto.Tests';\nimport { DynamicProtoMultipleCallTests } from '../DynamicProtoMultipleCall.Tests';\nimport { DynamicProtoNoInstTests } from '../DynamicProtoNoInst.Tests';\nimport { DynamicProtoMultipleNoInstTests } from '../DynamicProtoMultipleNoInst.Tests';\nimport { SecurityCheckTests } from '../SecurityCheck.Tests';\n\nexport function runTests() {\n new DynamicProtoDefaultTests(\"Default\").registerTests();\n new DynamicProtoMultipleCallTests(\"Multiple\").registerTests();\n new DynamicProtoNoInstTests(\"SetInst\").registerTests();\n new DynamicProtoMultipleNoInstTests(\"Multiple SetInst\").registerTests();\n new SecurityCheckTests(\"Security Checks\").registerTests();\n}\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 26ae575..bbeaa5b 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,13 @@ }, "devDependencies": { "@microsoft/rush": "5.148.0", - "@nevware21/grunt-ts-plugin": "^0.3.0", "@nevware21/grunt-eslint-ts": "^0.1.0", + "@nevware21/grunt-ts-plugin": "^0.3.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^2.3.3", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", + "copyfiles": "^2.4.1", "eslint": "^7.29.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.23.4", @@ -63,12 +66,9 @@ "grunt-contrib-qunit": "^4.0.0", "grunt-contrib-uglify": "^5.0.1", "grunt-run": "^0.8.1", - "@rollup/plugin-node-resolve": "^9.0.0", - "@rollup/plugin-replace": "^2.3.3", - "rollup-plugin-cleanup": "3.2.1", "rollup": "^2.32.0", + "rollup-plugin-cleanup": "3.2.1", "typedoc": "^0.23.25", - "typescript": "^4.9.5", - "copyfiles": "^2.4.1" + "typescript": "^4.9.5" } } From 61dc48ca9a2c24f6fe5d11bceb6e88bee3285c2d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 19:20:50 +0000 Subject: [PATCH 16/22] Remove generated test files excluded by .gitignore Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/test/Selenium/dynamicprototests.d.ts | 301 -- lib/test/Selenium/dynamicprototests.js | 3802 -------------------- lib/test/Selenium/dynamicprototests.js.map | 1 - 3 files changed, 4104 deletions(-) delete mode 100644 lib/test/Selenium/dynamicprototests.d.ts delete mode 100644 lib/test/Selenium/dynamicprototests.js delete mode 100644 lib/test/Selenium/dynamicprototests.js.map diff --git a/lib/test/Selenium/dynamicprototests.d.ts b/lib/test/Selenium/dynamicprototests.d.ts deleted file mode 100644 index 5b2eebd..0000000 --- a/lib/test/Selenium/dynamicprototests.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -/// -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -declare class Assert { - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static deepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static equal(expected: any, actual: any, message?: string): any; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static notDeepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notEqual(expected: any, actual: any, message?: string): any; - static notPropEqual(expected: any, actual: any, message?: string): any; - static propEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notStrictEqual(expected: any, actual: any, message?: string): any; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - static ok(state: any, message?: string): any; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static strictEqual(expected: any, actual: any, message?: string): any; - /** - * Assertion to test if a callback throws an exception when run. - * - * When testing code that is expected to throw an exception based on a specific set of - * circumstances, use throws() to catch the error object for testing and comparison. - * - * @param block Function to execute - * @param expected Error Object to compare - * @param message A short description of the assertion - */ - static throws(block: () => any, expected: any, message?: string): any; - /** - * @param block Function to execute - * @param message A short description of the assertion - */ - static throws(block: () => any, message?: string): any; -} -/** Defines a test case */ -declare class TestCase { - /** Name to use for the test case */ - name: string; - /** Test case method */ - test: () => void; -} -/** Defines a test case */ -interface TestCaseAsync { - /** Name to use for the test case */ - name: string; - /** time to wait after pre before invoking post and calling start() */ - stepDelay: number; - /** async steps */ - steps: Array<() => void>; -} -declare class TestClass { - constructor(name?: string); - static isPollingStepFlag: string; - /** The instance of the currently running suite. */ - static currentTestClass: TestClass; - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - useFakeTimers: boolean; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - useFakeServer: boolean; - /** Method called before the start of each test method */ - testInitialize(): void; - /** Method called after each test method has completed */ - testCleanup(): void; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - registerTests(): void; - /** Register an async Javascript unit testcase. */ - testCaseAsync(testInfo: TestCaseAsync): void; - /** Register a Javascript unit testcase. */ - testCase(testInfo: TestCase): void; - /** Called when the test is starting. */ - private _testStarting; - /** Called when the test is completed. */ - private _testCompleted; - /**** Sinon methods and properties ***/ - clock: SinonFakeTimers; - server: SinonFakeServer; - sandbox: SinonSandbox; - /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ - spy(): SinonSpy; - /** Spies on the provided function */ - spy(funcToWrap: Function): SinonSpy; - /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ - spy(object: any, methodName: string, func?: Function): SinonSpy; - /** Creates an anonymous stub function. */ - stub(): SinonStub; - /** Stubs all the object's methods. */ - stub(object: any): SinonStub; - /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ - stub(object: any, methodName: string, func?: Function): SinonStub; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - mock(object: any): SinonMock; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; - protected setUserAgent(userAgent: string): void; -} -declare module "src/DynamicProto" { - /** - * Interface to define additional configuration options to control how the dynamic prototype functions operate. - */ - export interface IDynamicProtoOpts { - /** - * Should the dynamic prototype attempt to set an instance function for instances that do not already have an - * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function. - */ - setInstFuncs: boolean; - /** - * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions - * and bypass the prototype lookups. Defaults to true. - */ - useBaseInst?: boolean; - } - /** - * The delegate signature for the function used as the callback for dynamicProto() - * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even - * though it is only a proxy that only contains the functions - * @param theTarget This is the real "this" of the current target object - * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the "this" instance before - * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the "super" keyword. - */ - export type DynamicProtoDelegate = (theTarget: DPType, baseFuncProxy?: DPType) => void; - /** - * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- - * - Saves references to all defined base class functions - * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. - * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. - * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is - * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of - * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" - * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions - * defined in the constructor or some other function (rather than declared as complete typescript functions). - * ### Usage - * ```typescript - * import dynamicProto from "@microsoft/dynamicproto-js"; - * class ExampleClass extends BaseClass { - * constructor() { - * dynamicProto(ExampleClass, this, (_self, base) => { - * // This will define a function that will be converted to a prototype function - * _self.newFunc = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * ... - * } - * } - * // This will define a function that will be converted to a prototype function - * _self.myFunction = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * // Call the base version of the function that we are overriding - * base.myFunction(); - * } - * ... - * } - * _self.initialize = () => { - * ... - * } - * // Warnings: While the following will work as _self is simply a reference to - * // this, if anyone overrides myFunction() the overridden will be called first - * // as the normal JavaScript method resolution will occur and the defined - * // _self.initialize() function is actually gets removed from the instance and - * // a proxy prototype version is created to reference the created method. - * _self.initialize(); - * }); - * } - * } - * ``` - * @typeparam DPType This is the generic type of the class, used to keep intellisense valid - * @typeparam DPCls The type that contains the prototype of the current class - * @param theClass - This is the current class instance which contains the prototype for the current class - * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. - * @param delegateFunc - The callback function (closure) that will create the dynamic function - * @param options - Additional options to configure how the dynamic prototype operates - */ - export default function dynamicProto(theClass: DPCls, target: DPType, delegateFunc: DynamicProtoDelegate, options?: IDynamicProtoOpts): void; -} -declare module "test/DynamicProto.Tests" { - export class DynamicProtoDefaultTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/DynamicProtoMultipleCall.Tests" { - export class DynamicProtoMultipleCallTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/DynamicProtoNoInst.Tests" { - export class DynamicProtoNoInstTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/DynamicProtoMultipleNoInst.Tests" { - export class DynamicProtoMultipleNoInstTests extends TestClass { - testInitialize(): void; - private _validateOrder; - private doTest; - registerTests(): void; - } -} -declare module "test/SecurityCheck.Tests" { - export class SecurityCheckTests extends TestClass { - testInitialize(): void; - registerTests(): void; - } -} -declare module "test/Selenium/DynamicProtoTests" { - export function runTests(): void; -} diff --git a/lib/test/Selenium/dynamicprototests.js b/lib/test/Selenium/dynamicprototests.js deleted file mode 100644 index 9e605cf..0000000 --- a/lib/test/Selenium/dynamicprototests.js +++ /dev/null @@ -1,3802 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -var Assert = /** @class */ (function () { - function Assert() { - } - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.deepEqual = function (expected, actual, message) { - return deepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.equal = function (expected, actual, message) { - return equal(actual, expected, message); - }; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.notDeepEqual = function (expected, actual, message) { - return notDeepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notEqual = function (expected, actual, message) { - return notEqual(actual, expected, message); - }; - Assert.notPropEqual = function (expected, actual, message) { - return notPropEqual(actual, expected, message); - }; - Assert.propEqual = function (expected, actual, message) { - return propEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notStrictEqual = function (expected, actual, message) { - return notStrictEqual(actual, expected, message); - }; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - Assert.ok = function (state, message) { - return ok(state, message); - }; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.strictEqual = function (expected, actual, message) { - return strictEqual(actual, expected, message); - }; - Assert.throws = function (block, expected, message) { - return throws(block, expected, message); - }; - return Assert; -}()); -/** Defines a test case */ -var TestCase = /** @class */ (function () { - function TestCase() { - } - return TestCase; -}()); -/// -/// -/// -/// -var TestClass = /** @class */ (function () { - function TestClass(name) { - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - this.useFakeTimers = true; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - this.useFakeServer = true; - QUnit.module(name); - } - /** Method called before the start of each test method */ - TestClass.prototype.testInitialize = function () { - }; - /** Method called after each test method has completed */ - TestClass.prototype.testCleanup = function () { - }; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - TestClass.prototype.registerTests = function () { - }; - /** Register an async Javascript unit testcase. */ - TestClass.prototype.testCaseAsync = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (isNaN(testInfo.stepDelay)) { - throw new Error("Must specify 'stepDelay' period between pre and post"); - } - if (!testInfo.steps) { - throw new Error("Must specify 'steps' to take asynchronously"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function (assert) { - var done = assert.async(); - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - var steps_1 = testInfo.steps; - var trigger_1 = function () { - if (steps_1.length) { - var step = steps_1.shift(); - // The callback which activates the next test step. - var nextTestStepTrigger = function () { - setTimeout(function () { - trigger_1(); - }, testInfo.stepDelay); - }; - // There 2 types of test steps - simple and polling. - // Upon completion of the simple test step the next test step will be called. - // In case of polling test step the next test step is passed to the polling test step, and - // it is responsibility of the polling test step to call the next test step. - try { - if (step[TestClass.isPollingStepFlag]) { - step.call(_this, nextTestStepTrigger); - } - else { - step.call(_this); - nextTestStepTrigger.call(_this); - } - } - catch (e) { - _this._testCompleted(); - Assert.ok(false, e.toString()); - // done is QUnit callback indicating the end of the test - done(); - return; - } - } - else { - _this._testCompleted(); - // done is QUnit callback indicating the end of the test - done(); - } - }; - trigger_1(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - // done is QUnit callback indicating the end of the test - done(); - } - }; - // Register the test with QUnit - QUnit.test(testInfo.name, testMethod); - }; - /** Register a Javascript unit testcase. */ - TestClass.prototype.testCase = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (!testInfo.test) { - throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function () { - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - testInfo.test.call(_this); - _this._testCompleted(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - } - }; - // Register the test with QUnit - test(testInfo.name, testMethod); - }; - /** Called when the test is starting. */ - TestClass.prototype._testStarting = function () { - // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. - var config = sinon.getConfig(sinon.config); - config.useFakeTimers = this.useFakeTimers; - config.useFakeServer = this.useFakeServer; - config.injectInto = config.injectIntoThis && this || config.injectInto; - this.sandbox = sinon.sandbox.create(config); - this.server = this.sandbox.server; - // Allow the derived class to perform test initialization. - this.testInitialize(); - }; - /** Called when the test is completed. */ - TestClass.prototype._testCompleted = function (failed) { - if (failed) { - // Just cleanup the sandbox since the test has already failed. - this.sandbox.restore(); - } - else { - // Verify the sandbox and restore. - this.sandbox.verifyAndRestore(); - } - this.testCleanup(); - // Clear the instance of the currently running suite. - TestClass.currentTestClass = null; - }; - TestClass.prototype.spy = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - TestClass.prototype.stub = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - TestClass.prototype.mock = function (object) { return null; }; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { - if (errorCode === undefined) { - errorCode = 200; - } - request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); - }; - TestClass.prototype.setUserAgent = function (userAgent) { - Object.defineProperty(window.navigator, 'userAgent', { - configurable: true, - get: function () { - return userAgent; - } - }); - }; - TestClass.isPollingStepFlag = "isPollingStep"; - return TestClass; -}()); -// Configure Sinon -sinon.assert.fail = function (msg) { - Assert.ok(false, msg); -}; -sinon.assert.pass = function (assertion) { - Assert.ok(assertion, "sinon assert"); -}; -sinon.config = { - injectIntoThis: true, - injectInto: null, - properties: ["spy", "stub", "mock", "clock", "sandbox"], - useFakeTimers: true, - useFakeServer: true -}; -/// -/// -/// -/// -/// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -define("src/DynamicProto", ["require", "exports", "@nevware21/ts-utils"], function (require, exports, ts_utils_1) { - "use strict"; - var _a; - Object.defineProperty(exports, "__esModule", { value: true }); - ; - /** - * Helper to check if we're running in a restricted environment that doesn't support - * property redefinition, like Cloudflare Workers. This is primarily used to avoid - * operations that would cause issues in these environments. - * @ignore - */ - function _isRestrictedEnvironment() { - try { - // Test if we can perform property definition/redefinition - // This specifically targets restricted environments like Cloudflare Workers - // where property redefinition causes errors - var testObj = {}; - var testProp = "testProperty"; - Object.defineProperty(testObj, testProp, { - configurable: true, - value: 1 - }); - Object.defineProperty(testObj, testProp, { - configurable: true, - value: 2 - }); - // If we can redefine properties, not a restricted environment - return false; - } - catch (e) { - // If property redefinition fails, we're in a restricted environment - return true; - } - } - /** - * Constant string defined to support minimization - * @ignore - */ - var Constructor = 'constructor'; - /** - * Constant string defined to support minimization - * @ignore - */ - var Prototype = 'prototype'; - /** - * Constant string defined to support minimization - * @ignore - */ - var strFunction = 'function'; - /** - * Used to define the name of the instance function lookup table - * @ignore - */ - var DynInstFuncTable = '_dynInstFuncs'; - /** - * Name used to tag the dynamic prototype function - * @ignore - */ - var DynProxyTag = '_isDynProxy'; - /** - * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table - * @ignore - */ - var DynClassName = '_dynClass'; - /** - * Prefix added to the classname to avoid any name clashes with other instance level properties - * @ignore - */ - var DynClassNamePrefix = '_dynCls$'; - /** - * A tag which is used to check if we have already to attempted to set the instance function if one is not present - * @ignore - */ - var DynInstChkTag = '_dynInstChk'; - /** - * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same - * tag name as the function level but a different const name for readability only. - */ - var DynAllowInstChkTag = DynInstChkTag; - /** - * The global (imported) instances where the global performance options are stored - */ - var DynProtoDefaultOptions = '_dfOpts'; - /** - * Value used as the name of a class when it cannot be determined - * @ignore - */ - var UnknownValue = '_unknown_'; - /** - * Constant string defined to support minimization - * @ignore - */ - var str__Proto = "__proto__"; - /** - * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist - */ - var DynProtoBaseProto = "_dyn" + str__Proto; - /** - * Runtime Global holder for dynamicProto settings - */ - var DynProtoGlobalSettings = "__dynProto$Gbl"; - /** - * Track the current prototype for IE8 as you can't look back to get the prototype - */ - var DynProtoCurrent = "_dynInstProto"; - /** - * Constant string defined to support minimization - * @ignore - */ - var strUseBaseInst = 'useBaseInst'; - /** - * Constant string defined to support minimization - * @ignore - */ - var strSetInstFuncs = 'setInstFuncs'; - var Obj = Object; - /** - * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) - * @ignore - */ - var _objGetPrototypeOf = Obj["getPrototypeOf"]; - /** - * Pre-lookup to check for the existence of this function - */ - var _objGetOwnProps = Obj["getOwnPropertyNames"]; - // Since 1.1.7 moving these to the runtime global to work around mixed version and module issues - // See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details - var _gbl = (0, ts_utils_1.getGlobal)(); - var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = { - o: (_a = {}, - _a[strSetInstFuncs] = true, - _a[strUseBaseInst] = true, - _a), - n: 1000 // Start new global index @ 1000 so we "fix" some cases when mixed with 1.1.6 or earlier - }); - /** - * Helper used to check whether the target is an Object prototype or Array prototype - * @ignore - */ - function _isObjectOrArrayPrototype(target) { - return target && (target === Obj[Prototype] || target === Array[Prototype]); - } - /** - * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype - * @ignore - */ - function _isObjectArrayOrFunctionPrototype(target) { - return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; - } - /** - * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. - * @ignore - */ - function _getObjProto(target) { - var newProto; - if (target) { - // This method doesn't exist in older browsers (e.g. IE8) - if (_objGetPrototypeOf) { - return _objGetPrototypeOf(target); - } - var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); - // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class - newProto = target[DynProtoBaseProto] || curProto; - if (!(0, ts_utils_1.objHasOwnProperty)(target, DynProtoBaseProto)) { - // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it - // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) - delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy - newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; - target[DynProtoCurrent] = curProto; - } - } - return newProto; - } - /** - * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 - * are not enumerable. - * @param target - */ - function _forEachProp(target, func) { - var props = []; - if (_objGetOwnProps) { - props = _objGetOwnProps(target); - } - else { - for (var name_1 in target) { - if (typeof name_1 === "string" && (0, ts_utils_1.objHasOwnProperty)(target, name_1)) { - props.push(name_1); - } - } - } - if (props && props.length > 0) { - for (var lp = 0; lp < props.length; lp++) { - func(props[lp]); - } - } - } - /** - * Helper function to check whether the provided function name is a potential candidate for dynamic - * callback and prototype generation. - * @param target The target object, may be a prototype or class object - * @param funcName The function name - * @param skipOwn Skips the check for own property - * @ignore - */ - function _isDynamicCandidate(target, funcName, skipOwn) { - return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || (0, ts_utils_1.objHasOwnProperty)(target, funcName)) && funcName !== str__Proto && funcName !== Prototype); - } - /** - * Helper to throw a TypeError exception - * @param message the message - * @ignore - */ - function _throwTypeError(message) { - (0, ts_utils_1.throwTypeError)("DynamicProto: " + message); - } - /** - * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does - * not return any inherited functions - * @param thisTarget The object to get the instance functions from - * @ignore - */ - function _getInstanceFuncs(thisTarget) { - // Get the base proto - var instFuncs = (0, ts_utils_1.objCreate)(null); - // Save any existing instance functions - _forEachProp(thisTarget, function (name) { - // Don't include any dynamic prototype instances - as we only want the real functions - if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { - // Create an instance callback for passing the base function to the caller - instFuncs[name] = thisTarget[name]; - } - }); - return instFuncs; - } - /** - * Returns whether the value is included in the array - * @param values The array of values - * @param value The value - */ - function _hasVisited(values, value) { - for (var lp = values.length - 1; lp >= 0; lp--) { - if (values[lp] === value) { - return true; - } - } - return false; - } - /** - * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" - * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references - * @param target The current instance - * @ignore - */ - function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { - function _instFuncProxy(target, funcHost, funcName) { - var theFunc = funcHost[funcName]; - if (theFunc[DynProxyTag] && useBaseInst) { - // grab and reuse the hosted looking function (if available) otherwise the original passed function - var instFuncTable = target[DynInstFuncTable] || {}; - if (instFuncTable[DynAllowInstChkTag] !== false) { - theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; - } - } - return function () { - // eslint-disable-next-line prefer-rest-params - return theFunc.apply(target, arguments); - }; - } - // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) - var baseFuncs = (0, ts_utils_1.objCreate)(null); - _forEachProp(instFuncs, function (name) { - // Create an instance callback for passing the base function to the caller - baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); - }); - // Get the base prototype functions - var baseProto = _getObjProto(classProto); - var visited = []; - // Don't include base object functions for Object, Array or Function - while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { - // look for prototype functions - _forEachProp(baseProto, function (name) { - // Don't include any dynamic prototype instances - as we only want the real functions - // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the - // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return - // the Object prototype methods while bypassing the check - if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { - // Create an instance callback for passing the base function to the caller - baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); - } - }); - // We need to find all possible functions that might be overloaded by walking the entire prototype chain - // This avoids the caller from needing to check whether it's direct base class implements the function or not - // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. - visited.push(baseProto); - baseProto = _getObjProto(baseProto); - } - return baseFuncs; - } - function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { - var instFunc = null; - // We need to check whether the class name is defined directly on this prototype otherwise - // it will walk the proto chain and return any parent proto classname. - if (target && (0, ts_utils_1.objHasOwnProperty)(proto, DynClassName)) { - var instFuncTable = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); - instFunc = (instFuncTable[proto[DynClassName]] || (0, ts_utils_1.objCreate)(null))[funcName]; - if (!instFunc) { - // Avoid stack overflow from recursive calling the same function - _throwTypeError("Missing [" + funcName + "] " + strFunction); - } - // We have the instance function, lets check it we can speed up further calls - // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) - if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { - // If the instance already has an instance function we can't replace it - var canAddInst = !(0, ts_utils_1.objHasOwnProperty)(target, funcName); - // Get current prototype - var objProto = _getObjProto(target); - var visited = []; - // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function - // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut - while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { - var protoFunc = objProto[funcName]; - if (protoFunc) { - canAddInst = (protoFunc === currentDynProtoProxy); - break; - } - // We need to find all possible initial functions to ensure that we don't bypass a valid override function - visited.push(objProto); - objProto = _getObjProto(objProto); - } - try { - if (canAddInst) { - // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version - // so it's safe to directly assign for any subsequent calls (for better performance) - target[funcName] = instFunc; - } - // Block further attempts to set the instance function for any - instFunc[DynInstChkTag] = 1; - } - catch (e) { - // Don't crash if the object is readonly or the runtime doesn't allow changing this - // And set a flag so we don't try again for any function - instFuncTable[DynAllowInstChkTag] = false; - } - } - } - return instFunc; - } - function _getProtoFunc(funcName, proto, currentDynProtoProxy) { - var protoFunc = proto[funcName]; - // Check that the prototype function is not a self reference -- try to avoid stack overflow! - if (protoFunc === currentDynProtoProxy) { - // It is so lookup the base prototype - protoFunc = _getObjProto(proto)[funcName]; - } - if (typeof protoFunc !== strFunction) { - _throwTypeError("[" + funcName + "] is not a " + strFunction); - } - return protoFunc; - } - /** - * Add the required dynamic prototype methods to the the class prototype - * @param proto - The class prototype - * @param className - The instance classname - * @param target - The target instance - * @param baseInstFuncs - The base instance functions - * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist - * @ignore - */ - function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { - function _createDynamicPrototype(proto, funcName) { - var dynProtoProxy = function () { - // Use the instance or prototype function - var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); - // eslint-disable-next-line prefer-rest-params - return instFunc.apply(this, arguments); - }; - // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing - // via which can dynamically replace the prototype function reference) - try { - dynProtoProxy[DynProxyTag] = 1; - } - catch (e) { - // Ignore errors in restricted environments like Cloudflare Workers - } - return dynProtoProxy; - } - if (!_isObjectOrArrayPrototype(proto)) { - var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || (0, ts_utils_1.objCreate)(null); - if (!_isObjectOrArrayPrototype(instFuncTable)) { - var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || (0, ts_utils_1.objCreate)(null)); // fetch and assign if as it may not exist yet - // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable - if (instFuncTable[DynAllowInstChkTag] !== false) { - instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; - } - if (!_isObjectOrArrayPrototype(instFuncs_1)) { - _forEachProp(target, function (name) { - // Only add overridden functions - if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { - // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function - instFuncs_1[name] = target[name]; - try { - delete target[name]; - } - catch (e) { - // Ignore errors in restricted environments like Cloudflare Workers - } - // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one - if (!(0, ts_utils_1.objHasOwnProperty)(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { - proto[name] = _createDynamicPrototype(proto, name); - } - } - }); - } - } - } - } - /** - * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance - * @param classProto The class prototype instance - * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy - * @ignore - */ - function _checkPrototype(classProto, thisTarget) { - // This method doesn't existing in older browsers (e.g. IE8) - if (_objGetPrototypeOf) { - // As this is primarily a coding time check, don't bother checking if running in IE8 or lower - var visited = []; - var thisProto = _getObjProto(thisTarget); - while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { - if (thisProto === classProto) { - return true; - } - // This avoids the caller from needing to check whether it's direct base class implements the function or not - // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. - visited.push(thisProto); - thisProto = _getObjProto(thisProto); - } - return false; - } - // If objGetPrototypeOf doesn't exist then just assume everything is ok. - return true; - } - /** - * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. - * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. - * @param target - * @param unknownValue - * @ignore - */ - function _getObjName(target, unknownValue) { - if ((0, ts_utils_1.objHasOwnProperty)(target, Prototype)) { - // Look like a prototype - return target.name || unknownValue || UnknownValue; - } - return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; - } - /** - * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- - * - Saves references to all defined base class functions - * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. - * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. - * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is - * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of - * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" - * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions - * defined in the constructor or some other function (rather than declared as complete typescript functions). - * ### Usage - * ```typescript - * import dynamicProto from "@microsoft/dynamicproto-js"; - * class ExampleClass extends BaseClass { - * constructor() { - * dynamicProto(ExampleClass, this, (_self, base) => { - * // This will define a function that will be converted to a prototype function - * _self.newFunc = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * ... - * } - * } - * // This will define a function that will be converted to a prototype function - * _self.myFunction = () => { - * // Access any "this" instance property - * if (_self.someProperty) { - * // Call the base version of the function that we are overriding - * base.myFunction(); - * } - * ... - * } - * _self.initialize = () => { - * ... - * } - * // Warnings: While the following will work as _self is simply a reference to - * // this, if anyone overrides myFunction() the overridden will be called first - * // as the normal JavaScript method resolution will occur and the defined - * // _self.initialize() function is actually gets removed from the instance and - * // a proxy prototype version is created to reference the created method. - * _self.initialize(); - * }); - * } - * } - * ``` - * @typeparam DPType This is the generic type of the class, used to keep intellisense valid - * @typeparam DPCls The type that contains the prototype of the current class - * @param theClass - This is the current class instance which contains the prototype for the current class - * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. - * @param delegateFunc - The callback function (closure) that will create the dynamic function - * @param options - Additional options to configure how the dynamic prototype operates - */ - function dynamicProto(theClass, target, delegateFunc, options) { - // Make sure that the passed theClass argument looks correct - if (!(0, ts_utils_1.objHasOwnProperty)(theClass, Prototype)) { - _throwTypeError("theClass is an invalid class definition."); - } - // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) - var classProto = theClass[Prototype]; - if (!_checkPrototype(classProto, target)) { - _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]"); - } - var className = null; - if ((0, ts_utils_1.objHasOwnProperty)(classProto, DynClassName)) { - // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) - className = classProto[DynClassName]; - } - else { - // As not all browser support name on the prototype creating a unique dynamic one if we have not already - // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance - // function table lookup. - className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n; - _gblInst.n++; - try { - classProto[DynClassName] = className; - } - catch (e) { - // Ignore errors in restricted environments like Cloudflare Workers - } - } - var perfOptions = dynamicProto[DynProtoDefaultOptions]; - var useBaseInst = !!perfOptions[strUseBaseInst]; - if (useBaseInst && options && options[strUseBaseInst] !== undefined) { - useBaseInst = !!options[strUseBaseInst]; - } - // Get the current instance functions - var instFuncs = _getInstanceFuncs(target); - // Get all of the functions for any base instance (before they are potentially overridden) - var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); - // Execute the delegate passing in both the current target "this" and "base" function references - // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support - delegateFunc(target, baseFuncs); - // Don't allow setting instance functions in older browsers or restricted environments - var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isRestrictedEnvironment(); - if (setInstanceFunc && options) { - setInstanceFunc = !!options[strSetInstFuncs]; - } - // Populate the Prototype for any overridden instance functions - _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); - } - exports.default = dynamicProto; - /** - * Exposes the default global options to allow global configuration, if the global values are disabled these will override - * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose - * their internal usage of dynamic proto. - */ - dynamicProto[DynProtoDefaultOptions] = _gblInst.o; -}); -/// -define("test/DynamicProto.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoDefaultTests = void 0; - var InheritTest1 = /** @class */ (function () { - function InheritTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritTest1; - }()); - var InheritTest2 = /** @class */ (function (_super) { - __extends(InheritTest2, _super); - function InheritTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritTest2; - }(InheritTest1)); - var InheritTest3 = /** @class */ (function (_super) { - __extends(InheritTest3, _super); - function InheritTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritTest3; - }(InheritTest2)); - var DynInheritTest1 = /** @class */ (function () { - function DynInheritTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_1.default)(DynInheritTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }); - } - return DynInheritTest1; - }()); - var InheritTest4 = /** @class */ (function (_super) { - __extends(InheritTest4, _super); - function InheritTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritTest4; - }(DynInheritTest1)); - var InheritTest5 = /** @class */ (function (_super) { - __extends(InheritTest5, _super); - function InheritTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritTest5; - }(InheritTest4)); - var DynInheritTest2 = /** @class */ (function (_super) { - __extends(DynInheritTest2, _super); - function DynInheritTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_1.default)(DynInheritTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }); - return _this; - } - return DynInheritTest2; - }(InheritTest1)); - var DynInheritTest3 = /** @class */ (function (_super) { - __extends(DynInheritTest3, _super); - function DynInheritTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_1.default)(DynInheritTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }); - return _this; - } - return DynInheritTest3; - }(DynInheritTest2)); - var InheritTest6 = /** @class */ (function (_super) { - __extends(InheritTest6, _super); - function InheritTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritTest6; - }(DynInheritTest2)); - var DynInheritTest4 = /** @class */ (function (_super) { - __extends(DynInheritTest4, _super); - function DynInheritTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_1.default)(DynInheritTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }); - return _this; - } - return DynInheritTest4; - }(InheritTest6)); - var DynInheritTest5 = /** @class */ (function (_super) { - __extends(DynInheritTest5, _super); - function DynInheritTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_1.default)(DynInheritTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }); - return _this; - } - return DynInheritTest5; - }(DynInheritTest1)); - var DynInheritTest6 = /** @class */ (function (_super) { - __extends(DynInheritTest6, _super); - function DynInheritTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_1.default)(DynInheritTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }); - return _this; - } - return DynInheritTest6; - }(DynInheritTest5)); - var InstInherit1 = /** @class */ (function () { - function InstInherit1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInherit1; - }()); - var InstInherit2 = /** @class */ (function (_super) { - __extends(InstInherit2, _super); - function InstInherit2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInherit2; - }(InheritTest2)); - var InheritTest7 = /** @class */ (function (_super) { - __extends(InheritTest7, _super); - function InheritTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritTest7; - }(InstInherit1)); - var DynInheritTest7 = /** @class */ (function (_super) { - __extends(DynInheritTest7, _super); - function DynInheritTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_1.default)(DynInheritTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritTest7; - }(InstInherit1)); - var InstInherit3 = /** @class */ (function (_super) { - __extends(InstInherit3, _super); - function InstInherit3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInherit3; - }(DynInheritTest7)); - var DynInheritTest8 = /** @class */ (function (_super) { - __extends(DynInheritTest8, _super); - function DynInheritTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_1.default)(DynInheritTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }); - return _this; - } - return DynInheritTest8; - }(InstInherit3)); - var BadInstInherit1 = /** @class */ (function (_super) { - __extends(BadInstInherit1, _super); - function BadInstInherit1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInherit1; - }(InstInherit1)); - var DynInheritTest9 = /** @class */ (function (_super) { - __extends(DynInheritTest9, _super); - function DynInheritTest9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_1.default)(DynInheritTest9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }); - return _this; - } - return DynInheritTest9; - }(BadInstInherit1)); - var GoodInstInherit1 = /** @class */ (function (_super) { - __extends(GoodInstInherit1, _super); - function GoodInstInherit1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInherit1; - }(InstInherit1)); - var DynInheritTest10 = /** @class */ (function (_super) { - __extends(DynInheritTest10, _super); - function DynInheritTest10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_1.default)(DynInheritTest10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }); - return _this; - } - return DynInheritTest10; - }(GoodInstInherit1)); - var GoodInstInherit2 = /** @class */ (function (_super) { - __extends(GoodInstInherit2, _super); - function GoodInstInherit2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInherit2; - }(DynInheritTest10)); - var DynamicProtoDefaultTests = /** @class */ (function (_super) { - __extends(DynamicProtoDefaultTests, _super); - function DynamicProtoDefaultTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoDefaultTests.prototype.testInitialize = function () { - }; - DynamicProtoDefaultTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoDefaultTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoDefaultTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "Default: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritTest1(), [ - "InheritTest1()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInherit1(), [ - "InstInherit1()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInherit2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInherit3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInherit1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTest9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInherit1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTest10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInherit2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - ]); - } - }); - }; - return DynamicProtoDefaultTests; - }(TestClass)); - exports.DynamicProtoDefaultTests = DynamicProtoDefaultTests; -}); -/// -define("test/DynamicProtoMultipleCall.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_2) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoMultipleCallTests = void 0; - var InheritMultipleCallTest1 = /** @class */ (function () { - function InheritMultipleCallTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritMultipleCallTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritMultipleCallTest1; - }()); - var InheritMultipleCallTest2 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest2, _super); - function InheritMultipleCallTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritMultipleCallTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritMultipleCallTest2; - }(InheritMultipleCallTest1)); - var InheritMultipleCallTest3 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest3, _super); - function InheritMultipleCallTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritMultipleCallTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritMultipleCallTest3; - }(InheritMultipleCallTest2)); - var DynInheritMultipleCallTest1 = /** @class */ (function () { - function DynInheritMultipleCallTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }); - } - return DynInheritMultipleCallTest1; - }()); - var InheritMultipleCallTest4 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest4, _super); - function InheritMultipleCallTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritMultipleCallTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritMultipleCallTest4; - }(DynInheritMultipleCallTest1)); - var InheritMultipleCallTest5 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest5, _super); - function InheritMultipleCallTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritMultipleCallTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritMultipleCallTest5; - }(InheritMultipleCallTest4)); - var DynInheritMultipleCallTest2 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest2, _super); - function DynInheritMultipleCallTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest2; - }(InheritMultipleCallTest1)); - var DynInheritMultipleCallTest3 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest3, _super); - function DynInheritMultipleCallTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest3; - }(DynInheritMultipleCallTest2)); - var InheritMultipleCallTest6 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest6, _super); - function InheritMultipleCallTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritMultipleCallTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritMultipleCallTest6; - }(DynInheritMultipleCallTest2)); - var DynInheritMultipleCallTest4 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest4, _super); - function DynInheritMultipleCallTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest4; - }(InheritMultipleCallTest6)); - var DynInheritMultipleCallTest5 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest5, _super); - function DynInheritMultipleCallTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest5; - }(DynInheritMultipleCallTest1)); - var DynInheritMultipleCallTest6 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest6, _super); - function DynInheritMultipleCallTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest6; - }(DynInheritMultipleCallTest5)); - var InstInheritMultipleCall1 = /** @class */ (function () { - function InstInheritMultipleCall1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInheritMultipleCall1; - }()); - var InstInheritMultipleCall2 = /** @class */ (function (_super) { - __extends(InstInheritMultipleCall2, _super); - function InstInheritMultipleCall2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInheritMultipleCall2; - }(InheritMultipleCallTest2)); - var InheritMultipleCallTest7 = /** @class */ (function (_super) { - __extends(InheritMultipleCallTest7, _super); - function InheritMultipleCallTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritMultipleCallTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritMultipleCallTest7; - }(InstInheritMultipleCall1)); - var DynInheritMultipleCallTest7 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest7, _super); - function DynInheritMultipleCallTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest7; - }(InstInheritMultipleCall1)); - var InstInheritMultipleCall3 = /** @class */ (function (_super) { - __extends(InstInheritMultipleCall3, _super); - function InstInheritMultipleCall3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInheritMultipleCall3; - }(DynInheritMultipleCallTest7)); - var DynInheritMultipleCallTest8 = /** @class */ (function (_super) { - __extends(DynInheritMultipleCallTest8, _super); - function DynInheritMultipleCallTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_2.default)(DynInheritMultipleCallTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }); - return _this; - } - return DynInheritMultipleCallTest8; - }(InstInheritMultipleCall3)); - var BadInstInheritMultipleCall1 = /** @class */ (function (_super) { - __extends(BadInstInheritMultipleCall1, _super); - function BadInstInheritMultipleCall1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInheritMultipleCall1; - }(InstInheritMultipleCall1)); - var DynInheritTestMultipleCall9 = /** @class */ (function (_super) { - __extends(DynInheritTestMultipleCall9, _super); - function DynInheritTestMultipleCall9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_2.default)(DynInheritTestMultipleCall9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }); - return _this; - } - return DynInheritTestMultipleCall9; - }(BadInstInheritMultipleCall1)); - var GoodInstInheritMultipleCall1 = /** @class */ (function (_super) { - __extends(GoodInstInheritMultipleCall1, _super); - function GoodInstInheritMultipleCall1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInheritMultipleCall1; - }(InstInheritMultipleCall1)); - var DynInheritTestMultipleCall10 = /** @class */ (function (_super) { - __extends(DynInheritTestMultipleCall10, _super); - function DynInheritTestMultipleCall10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_2.default)(DynInheritTestMultipleCall10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }); - return _this; - } - return DynInheritTestMultipleCall10; - }(GoodInstInheritMultipleCall1)); - var GoodInstInheritMultipleCall2 = /** @class */ (function (_super) { - __extends(GoodInstInheritMultipleCall2, _super); - function GoodInstInheritMultipleCall2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInheritMultipleCall2; - }(DynInheritTestMultipleCall10)); - var DynamicProtoMultipleCallTests = /** @class */ (function (_super) { - __extends(DynamicProtoMultipleCallTests, _super); - function DynamicProtoMultipleCallTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoMultipleCallTests.prototype.testInitialize = function () { - }; - DynamicProtoMultipleCallTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoMultipleCallTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - theTest.testFunction(); - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoMultipleCallTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "MultipleCall: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritMultipleCallTest1(), [ - "InheritTest1()", - "InheritTest1.test()", - "InheritTest1.test()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritMultipleCallTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritMultipleCallTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritMultipleCallTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritMultipleCallTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritMultipleCallTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()", - "DynInheritTest1.test()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritMultipleCallTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritMultipleCallTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritMultipleCallTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritMultipleCallTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritMultipleCallTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritMultipleCallTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInheritMultipleCall1(), [ - "InstInherit1()", - "InstInherit1.test()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInheritMultipleCall2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritMultipleCallTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritMultipleCallTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInheritMultipleCall3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritMultipleCallTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInheritMultipleCall1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTestMultipleCall9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInheritMultipleCall1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTestMultipleCall10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInheritMultipleCall2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()" - ]); - } - }); - }; - return DynamicProtoMultipleCallTests; - }(TestClass)); - exports.DynamicProtoMultipleCallTests = DynamicProtoMultipleCallTests; -}); -/// -define("test/DynamicProtoNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_3) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoNoInstTests = void 0; - var InheritNoInstTest1 = /** @class */ (function () { - function InheritNoInstTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritNoInstTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritNoInstTest1; - }()); - var InheritNoInstTest2 = /** @class */ (function (_super) { - __extends(InheritNoInstTest2, _super); - function InheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritNoInstTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritNoInstTest2; - }(InheritNoInstTest1)); - var InheritNoInstTest3 = /** @class */ (function (_super) { - __extends(InheritNoInstTest3, _super); - function InheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritNoInstTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritNoInstTest3; - }(InheritNoInstTest2)); - var DynInheritNoInstTest1 = /** @class */ (function () { - function DynInheritNoInstTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }, { setInstFuncs: false }); - } - return DynInheritNoInstTest1; - }()); - var InheritNoInstTest4 = /** @class */ (function (_super) { - __extends(InheritNoInstTest4, _super); - function InheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritNoInstTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritNoInstTest4; - }(DynInheritNoInstTest1)); - var InheritNoInstTest5 = /** @class */ (function (_super) { - __extends(InheritNoInstTest5, _super); - function InheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritNoInstTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritNoInstTest5; - }(InheritNoInstTest4)); - var DynInheritNoInstTest2 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest2, _super); - function DynInheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest2; - }(InheritNoInstTest1)); - var DynInheritNoInstTest3 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest3, _super); - function DynInheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest3; - }(DynInheritNoInstTest2)); - var InheritNoInstTest6 = /** @class */ (function (_super) { - __extends(InheritNoInstTest6, _super); - function InheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritNoInstTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritNoInstTest6; - }(DynInheritNoInstTest2)); - var DynInheritNoInstTest4 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest4, _super); - function DynInheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest4; - }(InheritNoInstTest6)); - var DynInheritNoInstTest5 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest5, _super); - function DynInheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest5; - }(DynInheritNoInstTest1)); - var DynInheritNoInstTest6 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest6, _super); - function DynInheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest6; - }(DynInheritNoInstTest5)); - var InstInheritNoInst1 = /** @class */ (function () { - function InstInheritNoInst1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInheritNoInst1; - }()); - var InstInheritNoInst2 = /** @class */ (function (_super) { - __extends(InstInheritNoInst2, _super); - function InstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInheritNoInst2; - }(InheritNoInstTest2)); - var InheritNoInstTest7 = /** @class */ (function (_super) { - __extends(InheritNoInstTest7, _super); - function InheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritNoInstTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritNoInstTest7; - }(InstInheritNoInst1)); - var DynInheritNoInstTest7 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest7, _super); - function DynInheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritNoInstTest7; - }(InstInheritNoInst1)); - var InstInheritNoInst3 = /** @class */ (function (_super) { - __extends(InstInheritNoInst3, _super); - function InstInheritNoInst3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInheritNoInst3; - }(DynInheritNoInstTest7)); - var DynInheritNoInstTest8 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest8, _super); - function DynInheritNoInstTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_3.default)(DynInheritNoInstTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest8; - }(InstInheritNoInst3)); - var BadInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(BadInstInheritNoInst1, _super); - function BadInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst9 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst9, _super); - function DynInheritTestNoInst9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_3.default)(DynInheritTestNoInst9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst9; - }(BadInstInheritNoInst1)); - var GoodInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst1, _super); - function GoodInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst10 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst10, _super); - function DynInheritTestNoInst10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_3.default)(DynInheritTestNoInst10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst10; - }(GoodInstInheritNoInst1)); - var GoodInstInheritNoInst2 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst2, _super); - function GoodInstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInheritNoInst2; - }(DynInheritTestNoInst10)); - var DynamicProtoNoInstTests = /** @class */ (function (_super) { - __extends(DynamicProtoNoInstTests, _super); - function DynamicProtoNoInstTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoNoInstTests.prototype.testInitialize = function () { - }; - DynamicProtoNoInstTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoNoInstTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "NoInst: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritNoInstTest1(), [ - "InheritTest1()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritNoInstTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritNoInstTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritNoInstTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritNoInstTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritNoInstTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInheritNoInst1(), [ - "InstInherit1()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInheritNoInst2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritNoInstTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInheritNoInst3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - ]); - } - }); - }; - return DynamicProtoNoInstTests; - }(TestClass)); - exports.DynamicProtoNoInstTests = DynamicProtoNoInstTests; -}); -/// -define("test/DynamicProtoMultipleNoInst.Tests", ["require", "exports", "src/DynamicProto"], function (require, exports, DynamicProto_4) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoMultipleNoInstTests = void 0; - var InheritNoInstTest1 = /** @class */ (function () { - function InheritNoInstTest1() { - this.executionOrder = []; - this.executionOrder.push("InheritTest1()"); - } - InheritNoInstTest1.prototype.testFunction = function () { - this.executionOrder.push("InheritTest1.test()"); - }; - return InheritNoInstTest1; - }()); - var InheritNoInstTest2 = /** @class */ (function (_super) { - __extends(InheritNoInstTest2, _super); - function InheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest2()"); - return _this; - } - InheritNoInstTest2.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest2.test()"); - }; - return InheritNoInstTest2; - }(InheritNoInstTest1)); - var InheritNoInstTest3 = /** @class */ (function (_super) { - __extends(InheritNoInstTest3, _super); - function InheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest3()"); - return _this; - } - InheritNoInstTest3.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest3.test()"); - }; - return InheritNoInstTest3; - }(InheritNoInstTest2)); - var DynInheritNoInstTest1 = /** @class */ (function () { - function DynInheritNoInstTest1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("DynInheritTest1()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest1, this, function (_self, base) { - _self.testFunction = function () { - _this.executionOrder.push("DynInheritTest1.test()"); - }; - }, { setInstFuncs: false }); - } - return DynInheritNoInstTest1; - }()); - var InheritNoInstTest4 = /** @class */ (function (_super) { - __extends(InheritNoInstTest4, _super); - function InheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest4()"); - return _this; - } - InheritNoInstTest4.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest4.test()"); - }; - return InheritNoInstTest4; - }(DynInheritNoInstTest1)); - var InheritNoInstTest5 = /** @class */ (function (_super) { - __extends(InheritNoInstTest5, _super); - function InheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest5()"); - return _this; - } - InheritNoInstTest5.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest5.test()"); - }; - return InheritNoInstTest5; - }(InheritNoInstTest4)); - var DynInheritNoInstTest2 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest2, _super); - function DynInheritNoInstTest2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest2()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest2, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest2.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest2; - }(InheritNoInstTest1)); - var DynInheritNoInstTest3 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest3, _super); - function DynInheritNoInstTest3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest3()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest3, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest3.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest3; - }(DynInheritNoInstTest2)); - var InheritNoInstTest6 = /** @class */ (function (_super) { - __extends(InheritNoInstTest6, _super); - function InheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest6()"); - return _this; - } - InheritNoInstTest6.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest6.test()"); - }; - return InheritNoInstTest6; - }(DynInheritNoInstTest2)); - var DynInheritNoInstTest4 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest4, _super); - function DynInheritNoInstTest4() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest4()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest4, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest4.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest4; - }(InheritNoInstTest6)); - var DynInheritNoInstTest5 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest5, _super); - function DynInheritNoInstTest5() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest5()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest5, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest5.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest5; - }(DynInheritNoInstTest1)); - var DynInheritNoInstTest6 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest6, _super); - function DynInheritNoInstTest6() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest6()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest6, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest6.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest6; - }(DynInheritNoInstTest5)); - var InstInheritNoInst1 = /** @class */ (function () { - function InstInheritNoInst1() { - var _this = this; - this.executionOrder = []; - this.executionOrder.push("InstInherit1()"); - this.testFunction = function () { - _this.executionOrder.push("InstInherit1.test()"); - }; - } - return InstInheritNoInst1; - }()); - var InstInheritNoInst2 = /** @class */ (function (_super) { - __extends(InstInheritNoInst2, _super); - function InstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit2()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit2.test()"); - }; - return _this; - } - return InstInheritNoInst2; - }(InheritNoInstTest2)); - var InheritNoInstTest7 = /** @class */ (function (_super) { - __extends(InheritNoInstTest7, _super); - function InheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InheritTest7()"); - return _this; - } - InheritNoInstTest7.prototype.testFunction = function () { - _super.prototype.testFunction.call(this); - this.executionOrder.push("InheritTest7.test()"); - }; - return InheritNoInstTest7; - }(InstInheritNoInst1)); - var DynInheritNoInstTest7 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest7, _super); - function DynInheritNoInstTest7() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest7()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest7, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest7.test()"); - }; - }); - return _this; - } - return DynInheritNoInstTest7; - }(InstInheritNoInst1)); - var InstInheritNoInst3 = /** @class */ (function (_super) { - __extends(InstInheritNoInst3, _super); - function InstInheritNoInst3() { - var _this = _super.call(this) || this; - _this.executionOrder.push("InstInherit3()"); - _this.testFunction = function () { - _super.prototype.testFunction.call(_this); - _this.executionOrder.push("InstInherit3.test()"); - }; - return _this; - } - return InstInheritNoInst3; - }(DynInheritNoInstTest7)); - var DynInheritNoInstTest8 = /** @class */ (function (_super) { - __extends(DynInheritNoInstTest8, _super); - function DynInheritNoInstTest8() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest8()"); - (0, DynamicProto_4.default)(DynInheritNoInstTest8, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest8.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritNoInstTest8; - }(InstInheritNoInst3)); - var BadInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(BadInstInheritNoInst1, _super); - function BadInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("BadInstInherit1()"); - _this.testFunction = function () { - try { - _super.prototype.testFunction.call(_this); - } - catch (e) { - _this.executionOrder.push("BadInstInherit1.throw()"); - } - _this.executionOrder.push("BadInstInherit1.test()"); - }; - return _this; - } - return BadInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst9 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst9, _super); - function DynInheritTestNoInst9() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest9()"); - (0, DynamicProto_4.default)(DynInheritTestNoInst9, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest9.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst9; - }(BadInstInheritNoInst1)); - var GoodInstInheritNoInst1 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst1, _super); - function GoodInstInheritNoInst1() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit1()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit1.test()"); - }; - return _this; - } - return GoodInstInheritNoInst1; - }(InstInheritNoInst1)); - var DynInheritTestNoInst10 = /** @class */ (function (_super) { - __extends(DynInheritTestNoInst10, _super); - function DynInheritTestNoInst10() { - var _this = _super.call(this) || this; - _this.executionOrder.push("DynInheritTest10()"); - (0, DynamicProto_4.default)(DynInheritTestNoInst10, _this, function (_self, base) { - _self.testFunction = function () { - base.testFunction(); - _this.executionOrder.push("DynInheritTest10.test()"); - }; - }, { setInstFuncs: false }); - return _this; - } - return DynInheritTestNoInst10; - }(GoodInstInheritNoInst1)); - var GoodInstInheritNoInst2 = /** @class */ (function (_super) { - __extends(GoodInstInheritNoInst2, _super); - function GoodInstInheritNoInst2() { - var _this = _super.call(this) || this; - _this.executionOrder.push("GoodInstInherit2()"); - var prevTestFunc = _this.testFunction; - _this.testFunction = function () { - prevTestFunc.call(_this); - _this.executionOrder.push("GoodInstInherit2.test()"); - }; - return _this; - } - return GoodInstInheritNoInst2; - }(DynInheritTestNoInst10)); - var DynamicProtoMultipleNoInstTests = /** @class */ (function (_super) { - __extends(DynamicProtoMultipleNoInstTests, _super); - function DynamicProtoMultipleNoInstTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoMultipleNoInstTests.prototype.testInitialize = function () { - }; - DynamicProtoMultipleNoInstTests.prototype._validateOrder = function (message, actual, expected) { - QUnit.assert.equal(actual.length, expected.length, message + ": Checking the length"); - var passed = true; - var error = ""; - for (var lp = 0; lp < expected.length; lp++) { - if (lp < actual.length) { - if (actual[lp] !== expected[lp]) { - passed = false; - error += " **[" + actual[lp] + "!=" + expected[lp] + "]**;"; - } - else { - error += " " + expected[lp] + ";"; - } - } - else { - passed = false; - error += " --[" + expected[lp] + "]--;"; - } - } - // Fail test and log any extra unexpected calls - for (var lp = expected.length; lp < actual.length; lp++) { - passed = false; - error += " ++[" + actual[lp] + "]++;"; - } - QUnit.assert.ok(passed, message + ":" + error); - }; - DynamicProtoMultipleNoInstTests.prototype.doTest = function (message, theTest, expectedOrder) { - theTest.testFunction(); - theTest.testFunction(); - this._validateOrder(message, theTest.executionOrder, expectedOrder); - }; - DynamicProtoMultipleNoInstTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "NoInst: Inheritance tests", - test: function () { - _this.doTest("InheritTest1", new InheritNoInstTest1(), [ - "InheritTest1()", - "InheritTest1.test()", - "InheritTest1.test()" - ]); - _this.doTest("InheritTest2", new InheritNoInstTest2(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest1.test()", - "InheritTest2.test()" - ]); - _this.doTest("InheritTest3", new InheritNoInstTest3(), [ - "InheritTest1()", - "InheritTest2()", - "InheritTest3()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InheritTest3.test()" - ]); - _this.doTest("InheritTest4", new InheritNoInstTest4(), [ - "DynInheritTest1()", - "InheritTest4()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "DynInheritTest1.test()", - "InheritTest4.test()" - ]); - _this.doTest("InheritTest5", new InheritNoInstTest5(), [ - "DynInheritTest1()", - "InheritTest4()", - "InheritTest5()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()", - "DynInheritTest1.test()", - "InheritTest4.test()", - "InheritTest5.test()" - ]); - _this.doTest("DynInheritTest1", new DynInheritNoInstTest1(), [ - "DynInheritTest1()", - "DynInheritTest1.test()", - "DynInheritTest1.test()" - ]); - _this.doTest("DynInheritTest2", new DynInheritNoInstTest2(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest1.test()", - "DynInheritTest2.test()" - ]); - _this.doTest("DynInheritTest3", new DynInheritNoInstTest3(), [ - "InheritTest1()", - "DynInheritTest2()", - "DynInheritTest3()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "DynInheritTest3.test()" - ]); - _this.doTest("InheritTest6", new InheritNoInstTest6(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()" - ]); - _this.doTest("DynInheritTest4", new DynInheritNoInstTest4(), [ - "InheritTest1()", - "DynInheritTest2()", - "InheritTest6()", - "DynInheritTest4()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()", - "InheritTest1.test()", - "DynInheritTest2.test()", - "InheritTest6.test()", - "DynInheritTest4.test()" - ]); - _this.doTest("DynInheritTest5", new DynInheritNoInstTest5(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()" - ]); - _this.doTest("DynInheritTest6", new DynInheritNoInstTest6(), [ - "DynInheritTest1()", - "DynInheritTest5()", - "DynInheritTest6()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()", - "DynInheritTest1.test()", - "DynInheritTest5.test()", - "DynInheritTest6.test()" - ]); - _this.doTest("InstInherit1", new InstInheritNoInst1(), [ - "InstInherit1()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - _this.doTest("InstInherit2", new InstInheritNoInst2(), [ - "InheritTest1()", - "InheritTest2()", - "InstInherit2()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()", - "InheritTest1.test()", - "InheritTest2.test()", - "InstInherit2.test()" - ]); - // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this - _this.doTest("InheritTest7", new InheritNoInstTest7(), [ - "InstInherit1()", - "InheritTest7()", - "InstInherit1.test()", - "InstInherit1.test()" - ]); - // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario - _this.doTest("DynInheritTest7", new DynInheritNoInstTest7(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit1.test()", - "DynInheritTest7.test()" - ]); - _this.doTest("InstInherit3", new InstInheritNoInst3(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()" - ]); - _this.doTest("DynInheritTest8", new DynInheritNoInstTest8(), [ - "InstInherit1()", - "DynInheritTest7()", - "InstInherit3()", - "DynInheritTest8()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()", - "InstInherit1.test()", - "DynInheritTest7.test()", - "InstInherit3.test()", - "DynInheritTest8.test()" - ]); - // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case - _this.doTest("BadInstInherit1", new BadInstInheritNoInst1(), [ - "InstInherit1()", - "BadInstInherit1()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()" - ]); - // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order - _this.doTest("DynInheritTest9", new DynInheritTestNoInst9(), [ - "InstInherit1()", - "BadInstInherit1()", - "DynInheritTest9()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()", - "BadInstInherit1.throw()", - "BadInstInherit1.test()", - "DynInheritTest9.test()" - ]); - _this.doTest("GoodInstInherit1", new GoodInstInheritNoInst1(), [ - "InstInherit1()", - "GoodInstInherit1()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()" - ]); - _this.doTest("DynInheritTest10", new DynInheritTestNoInst10(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()" - ]); - _this.doTest("GoodInstInherit2", new GoodInstInheritNoInst2(), [ - "InstInherit1()", - "GoodInstInherit1()", - "DynInheritTest10()", - "GoodInstInherit2()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()", - "InstInherit1.test()", - "GoodInstInherit1.test()", - "DynInheritTest10.test()", - "GoodInstInherit2.test()" - ]); - } - }); - }; - return DynamicProtoMultipleNoInstTests; - }(TestClass)); - exports.DynamicProtoMultipleNoInstTests = DynamicProtoMultipleNoInstTests; -}); -/// -define("test/SecurityCheck.Tests", ["require", "exports", "@nevware21/ts-utils", "src/DynamicProto"], function (require, exports, ts_utils_2, DynamicProto_5) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SecurityCheckTests = void 0; - var HackClass = /** @class */ (function () { - function HackClass() { - this.hello = "world"; - } - return HackClass; - }()); - var BadInstClass = /** @class */ (function () { - function BadInstClass() { - this._dynInstFuncs = {}; - this._dynInstFuncs = Object.prototype; - } - return BadInstClass; - }()); - var BadProxyInstClass = /** @class */ (function () { - function BadProxyInstClass() { - this._dynInstFuncs = {}; - this._dynInstFuncs = new Proxy(this, { - get: function (target, prop) { - if (typeof prop === "string" && prop.startsWith("_dynCls")) { - return Object.prototype; - } - return target[prop]; - } - }); - } - return BadProxyInstClass; - }()); - var SecurityCheckTests = /** @class */ (function (_super) { - __extends(SecurityCheckTests, _super); - function SecurityCheckTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - SecurityCheckTests.prototype.testInitialize = function () { - }; - SecurityCheckTests.prototype.registerTests = function () { - this.testCase({ - name: "Try to update Object.prototype directly", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(Object, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(Object.prototype, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(Object, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with a HackClass instance and __proto__ property", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self.__proto__ = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with a HackClass instance and __proto__ function", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self.__proto__ = function () { - testHack: true; - }; - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - Object.defineProperty(self, "__proto__", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - Object.defineProperty(self, "__proto__", { - value: function () { - testHack: true; - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype using HackClass instance with a __proto__ function", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self.__proto__ = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self.prototype = { - testHack2: true - }; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with HackClass and an object instance", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self.__proto__ = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance", - test: function () { - var a = {}; - try { - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - Object.defineProperty(self, "__proto__", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - }); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - QUnit.assert.ok(e.message.indexOf("not in hierarchy") > -1, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self["__proto__['hacked']"] = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - Object.defineProperty(self, "__proto__['hacked']", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype directly with a HackClass instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - self.__proto__ = { - testHack: true - }; - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly using defineProperty with a HackClass instance", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var self = _self; - self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - Object.defineProperty(self, "__proto__", { - value: { - testHack: true - }, - configurable: true, - enumerable: true - }); - self.prototype = { - testHack2: true - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly with a null prototype instance", - test: function () { - var a = {}; - var theInstance = Object.create(a); - try { - (0, DynamicProto_5.default)(theInstance, a, function (_self, base) { - _self.__proto__ = { - testHack: true - }; - _self.prototype = { - testHack2: true - }; - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack2"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly with an a prototype instance", - test: function () { - var a = {}; - var theInstance = Object.create(a); - try { - (0, DynamicProto_5.default)(Object.getPrototypeOf(theInstance), a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { - get: function (target, prop) { - if (typeof prop === "string" && prop.startsWith("_dynCls")) { - return Object.prototype; - } - return target[prop]; - } - }); - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var className = _self["_dynClass"]; - var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); - // Change the return class prototype to be Object.prototype - classProto["_dynCls" + className] = Object.prototype; - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - try { - (0, ts_utils_2.objGetPrototypeOf)(base).testHack = true; - QUnit.assert.fail("Should not be able to update Object.prototype"); - } - catch (e) { - QUnit.assert.ok(true, "Expected an exception to be thrown"); - } - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("testHack"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - _self["_dynInstFuncs"] = new Proxy(_self["_dynInstFuncs"] || {}, { - get: function (target, prop) { - if (typeof prop === "string" && prop.startsWith("_dynCls")) { - return Array.prototype; - } - return target[prop]; - } - }); - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Array.prototype"); - }; - }); - QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); - } - }); - this.testCase({ - name: "Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions", - test: function () { - var a = new HackClass(); - (0, DynamicProto_5.default)(HackClass, a, function (_self, base) { - var className = _self["_dynClass"]; - var classProto = _self["_dynInstFuncs"] = (_self["_dynInstFuncs"] || {}); - // Change the return class prototype to be Object.prototype - classProto["_dynCls" + className] = Array.prototype; - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Array.prototype"); - }; - }); - QUnit.assert.ok(!Array.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Array.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype with a BadInstClass instance", - test: function () { - var a = new BadInstClass(); - (0, DynamicProto_5.default)(BadInstClass, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); - } - }); - this.testCase({ - name: "Try to update Object.prototype with a BadProxyInstClass instance", - test: function () { - var a = new BadProxyInstClass(); - (0, DynamicProto_5.default)(BadProxyInstClass, a, function (_self, base) { - _self._testFunction = function () { - QUnit.assert.fail("Should not be able to update Object.prototype"); - }; - }); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_testFunction"), "Should not have polluted Object.prototype"); - QUnit.assert.ok(!Object.prototype.hasOwnProperty("_dynInstFuncs"), "Should not have polluted Object.prototype"); - } - }); - }; - return SecurityCheckTests; - }(TestClass)); - exports.SecurityCheckTests = SecurityCheckTests; -}); -define("test/Selenium/DynamicProtoTests", ["require", "exports", "test/DynamicProto.Tests", "test/DynamicProtoMultipleCall.Tests", "test/DynamicProtoNoInst.Tests", "test/DynamicProtoMultipleNoInst.Tests", "test/SecurityCheck.Tests"], function (require, exports, DynamicProto_Tests_1, DynamicProtoMultipleCall_Tests_1, DynamicProtoNoInst_Tests_1, DynamicProtoMultipleNoInst_Tests_1, SecurityCheck_Tests_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.runTests = void 0; - function runTests() { - new DynamicProto_Tests_1.DynamicProtoDefaultTests("Default").registerTests(); - new DynamicProtoMultipleCall_Tests_1.DynamicProtoMultipleCallTests("Multiple").registerTests(); - new DynamicProtoNoInst_Tests_1.DynamicProtoNoInstTests("SetInst").registerTests(); - new DynamicProtoMultipleNoInst_Tests_1.DynamicProtoMultipleNoInstTests("Multiple SetInst").registerTests(); - new SecurityCheck_Tests_1.SecurityCheckTests("Security Checks").registerTests(); - } - exports.runTests = runTests; -}); -//# sourceMappingURL=dynamicprototests.js.map \ No newline at end of file diff --git a/lib/test/Selenium/dynamicprototests.js.map b/lib/test/Selenium/dynamicprototests.js.map deleted file mode 100644 index b3a74e7..0000000 --- a/lib/test/Selenium/dynamicprototests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicprototests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/DynamicProto.ts","../DynamicProto.Tests.ts","../DynamicProtoMultipleCall.Tests.ts","../DynamicProtoNoInst.Tests.ts","../D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C,CAAC,aAAa,EAAE,CAAC;QACxE,IAAI,wCAAkB,CAAC,iBAAiB,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9D,CAAC;IAND,4BAMC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getGlobal, objCreate, objHasOwnProperty, throwTypeError } from \"@nevware21/ts-utils\";\n\ninterface DynamicGlobalSettings {\n /**\n * Stores the global options which will also be exposed on the runtime global\n */\n o: IDynamicProtoOpts,\n\n /**\n * Internal Global used to generate a unique dynamic class name, every new class will increase this value\n * @ignore\n */ \n n: number\n};\n\n\n\n/**\n * Helper to check if we're running in a restricted environment that doesn't support\n * property redefinition, like Cloudflare Workers. This is primarily used to avoid\n * operations that would cause issues in these environments.\n * @ignore\n */\nfunction _isRestrictedEnvironment(): boolean {\n try {\n // Test if we can perform property definition/redefinition\n // This specifically targets restricted environments like Cloudflare Workers\n // where property redefinition causes errors\n let testObj = {};\n let testProp = \"testProperty\";\n Object.defineProperty(testObj, testProp, { \n configurable: true,\n value: 1\n });\n Object.defineProperty(testObj, testProp, {\n configurable: true,\n value: 2\n });\n \n // If we can redefine properties, not a restricted environment\n return false;\n } catch (e) {\n // If property redefinition fails, we're in a restricted environment\n return true;\n }\n}\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Constructor = 'constructor';\n\n/**\n * Constant string defined to support minimization\n * @ignore\n */ \nconst Prototype = 'prototype';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strFunction = 'function';\n\n/**\n * Used to define the name of the instance function lookup table\n * @ignore\n */ \nconst DynInstFuncTable = '_dynInstFuncs';\n \n/**\n * Name used to tag the dynamic prototype function\n * @ignore\n */ \nconst DynProxyTag = '_isDynProxy';\n \n/**\n * Name added to a prototype to define the dynamic prototype \"class\" name used to lookup the function table\n * @ignore\n */ \nconst DynClassName = '_dynClass';\n \n/**\n * Prefix added to the classname to avoid any name clashes with other instance level properties\n * @ignore\n */ \nconst DynClassNamePrefix = '_dynCls$';\n \n/**\n * A tag which is used to check if we have already to attempted to set the instance function if one is not present\n * @ignore\n */\nconst DynInstChkTag = '_dynInstChk';\n \n/**\n * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same \n * tag name as the function level but a different const name for readability only.\n */\nconst DynAllowInstChkTag = DynInstChkTag;\n \n/**\n * The global (imported) instances where the global performance options are stored\n */\nconst DynProtoDefaultOptions = '_dfOpts';\n \n/**\n * Value used as the name of a class when it cannot be determined\n * @ignore\n */ \nconst UnknownValue = '_unknown_';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst str__Proto = \"__proto__\";\n \n/**\n * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist\n */\nconst DynProtoBaseProto = \"_dyn\" + str__Proto;\n\n/**\n * Runtime Global holder for dynamicProto settings\n */\nconst DynProtoGlobalSettings = \"__dynProto$Gbl\";\n\n/**\n * Track the current prototype for IE8 as you can't look back to get the prototype\n */\nconst DynProtoCurrent = \"_dynInstProto\";\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strUseBaseInst = 'useBaseInst';\n \n/**\n * Constant string defined to support minimization\n * @ignore\n */\nconst strSetInstFuncs = 'setInstFuncs';\n \nconst Obj = Object;\n\n/**\n * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)\n * @ignore\n */\nlet _objGetPrototypeOf = Obj[\"getPrototypeOf\"];\n\n/**\n * Pre-lookup to check for the existence of this function\n */\nlet _objGetOwnProps = Obj[\"getOwnPropertyNames\"];\n\n// Since 1.1.7 moving these to the runtime global to work around mixed version and module issues\n// See Issue https://github.com/microsoft/DynamicProto-JS/issues/57 for details\nlet _gbl = getGlobal();\nlet _gblInst: DynamicGlobalSettings = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {\n o: {\n [strSetInstFuncs]: true,\n [strUseBaseInst]: true\n },\n n: 1000 // Start new global index @ 1000 so we \"fix\" some cases when mixed with 1.1.6 or earlier\n});\n\n/**\n * Helper used to check whether the target is an Object prototype or Array prototype\n * @ignore\n */ \nfunction _isObjectOrArrayPrototype(target:any) {\n return target && (target === Obj[Prototype] || target === Array[Prototype]);\n}\n\n/**\n * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype\n * @ignore\n */ \nfunction _isObjectArrayOrFunctionPrototype(target:any) {\n return _isObjectOrArrayPrototype(target) || target === Function[Prototype];\n}\n\n/**\n * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.\n * @ignore\n */ \nfunction _getObjProto(target:any) {\n let newProto;\n\n if (target) {\n // This method doesn't exist in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n return _objGetPrototypeOf(target);\n }\n\n let curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);\n\n // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class\n newProto = target[DynProtoBaseProto] || curProto;\n if (!objHasOwnProperty(target, DynProtoBaseProto)) {\n // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it\n // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class)\n delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy\n newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];\n target[DynProtoCurrent] = curProto;\n }\n }\n\n return newProto;\n}\n\n/**\n * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6\n * are not enumerable.\n * @param target \n */\nfunction _forEachProp(target: any, func: (name: string) => void) {\n let props: string[] = [];\n if (_objGetOwnProps) {\n props = _objGetOwnProps(target);\n } else {\n for (let name in target) {\n if (typeof name === \"string\" && objHasOwnProperty(target, name)) {\n props.push(name);\n }\n }\n }\n\n if (props && props.length > 0) {\n for (let lp = 0; lp < props.length; lp++) {\n func(props[lp]);\n }\n }\n}\n\n/**\n * Helper function to check whether the provided function name is a potential candidate for dynamic\n * callback and prototype generation.\n * @param target The target object, may be a prototype or class object\n * @param funcName The function name\n * @param skipOwn Skips the check for own property\n * @ignore\n */\nfunction _isDynamicCandidate(target:any, funcName:string, skipOwn:boolean) {\n return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)) && funcName !== str__Proto && funcName !== Prototype);\n}\n\n/**\n * Helper to throw a TypeError exception\n * @param message the message\n * @ignore\n */\nfunction _throwTypeError(message:string) {\n throwTypeError(\"DynamicProto: \" + message);\n}\n\n/**\n * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does \n * not return any inherited functions\n * @param thisTarget The object to get the instance functions from\n * @ignore\n */\nfunction _getInstanceFuncs(thisTarget:any): any {\n // Get the base proto\n var instFuncs = objCreate(null);\n\n // Save any existing instance functions\n _forEachProp(thisTarget, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {\n // Create an instance callback for passing the base function to the caller\n instFuncs[name] = thisTarget[name];\n }\n });\n\n return instFuncs;\n}\n\n/**\n * Returns whether the value is included in the array\n * @param values The array of values\n * @param value The value\n */\nfunction _hasVisited(values:any[], value:any) {\n for (let lp = values.length - 1; lp >= 0; lp--) {\n if (values[lp] === value) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns an object that contains callback functions for all \"base/super\" functions, this is used to \"save\"\n * enabling calling super.xxx() functions without requiring that the base \"class\" has defined a prototype references\n * @param target The current instance\n * @ignore\n */\nfunction _getBaseFuncs(classProto:any, thisTarget:any, instFuncs:any, useBaseInst:boolean): any {\n function _instFuncProxy(target:any, funcHost: any, funcName: string) {\n let theFunc = funcHost[funcName];\n if (theFunc[DynProxyTag] && useBaseInst) {\n // grab and reuse the hosted looking function (if available) otherwise the original passed function\n let instFuncTable = target[DynInstFuncTable] || {};\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;\n }\n }\n\n return function() {\n // eslint-disable-next-line prefer-rest-params\n return theFunc.apply(target, arguments);\n };\n }\n\n // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced)\n var baseFuncs = objCreate(null);\n _forEachProp(instFuncs, (name) => {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);\n });\n \n // Get the base prototype functions\n var baseProto = _getObjProto(classProto);\n let visited:any[] = [];\n\n // Don't include base object functions for Object, Array or Function\n while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {\n // look for prototype functions\n _forEachProp(baseProto, (name) => {\n // Don't include any dynamic prototype instances - as we only want the real functions\n // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the \n // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return\n // the Object prototype methods while bypassing the check\n if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {\n // Create an instance callback for passing the base function to the caller\n baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);\n }\n });\n\n // We need to find all possible functions that might be overloaded by walking the entire prototype chain\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(baseProto);\n baseProto = _getObjProto(baseProto);\n }\n\n return baseFuncs;\n}\n\nfunction _getInstFunc(target: any, funcName: string, proto: any, currentDynProtoProxy: any) {\n let instFunc = null;\n\n // We need to check whether the class name is defined directly on this prototype otherwise\n // it will walk the proto chain and return any parent proto classname.\n if (target && objHasOwnProperty(proto, DynClassName)) {\n\n let instFuncTable = target[DynInstFuncTable] || objCreate(null);\n instFunc = (instFuncTable[proto[DynClassName]] || objCreate(null))[funcName];\n\n if (!instFunc) {\n // Avoid stack overflow from recursive calling the same function\n _throwTypeError(\"Missing [\" + funcName + \"] \" + strFunction);\n }\n\n // We have the instance function, lets check it we can speed up further calls\n // by adding the instance function back directly on the instance (avoiding the dynamic func lookup)\n if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {\n // If the instance already has an instance function we can't replace it\n let canAddInst = !objHasOwnProperty(target, funcName);\n\n // Get current prototype\n let objProto = _getObjProto(target);\n let visited:any[] = [];\n\n // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function\n // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut\n while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {\n let protoFunc = objProto[funcName];\n if (protoFunc) {\n canAddInst = (protoFunc === currentDynProtoProxy);\n break;\n }\n\n // We need to find all possible initial functions to ensure that we don't bypass a valid override function\n visited.push(objProto);\n objProto = _getObjProto(objProto);\n }\n\n try {\n if (canAddInst) {\n // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version\n // so it's safe to directly assign for any subsequent calls (for better performance)\n target[funcName] = instFunc;\n }\n\n // Block further attempts to set the instance function for any\n instFunc[DynInstChkTag] = 1;\n } catch (e) {\n // Don't crash if the object is readonly or the runtime doesn't allow changing this\n // And set a flag so we don't try again for any function\n instFuncTable[DynAllowInstChkTag] = false;\n }\n }\n }\n\n return instFunc;\n}\n\nfunction _getProtoFunc(funcName: string, proto: any, currentDynProtoProxy: any) {\n let protoFunc = proto[funcName];\n\n // Check that the prototype function is not a self reference -- try to avoid stack overflow!\n if (protoFunc === currentDynProtoProxy) {\n // It is so lookup the base prototype\n protoFunc = _getObjProto(proto)[funcName];\n }\n\n if (typeof protoFunc !== strFunction) {\n _throwTypeError(\"[\" + funcName + \"] is not a \" + strFunction);\n }\n\n return protoFunc;\n}\n\n/**\n * Add the required dynamic prototype methods to the the class prototype\n * @param proto - The class prototype\n * @param className - The instance classname \n * @param target - The target instance\n * @param baseInstFuncs - The base instance functions\n * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist\n * @ignore\n */\nfunction _populatePrototype(proto:any, className:string, target:any, baseInstFuncs:any, setInstanceFunc:boolean) {\n function _createDynamicPrototype(proto:any, funcName:string) {\n let dynProtoProxy = function() {\n // Use the instance or prototype function\n let instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);\n // eslint-disable-next-line prefer-rest-params\n return instFunc.apply(this, arguments);\n };\n \n // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing\n // via which can dynamically replace the prototype function reference)\n try {\n (dynProtoProxy as any)[DynProxyTag] = 1;\n } catch (e) {\n // Ignore errors in restricted environments like Cloudflare Workers\n }\n return dynProtoProxy;\n }\n \n if (!_isObjectOrArrayPrototype(proto)) {\n let instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || objCreate(null);\n if (!_isObjectOrArrayPrototype(instFuncTable)) {\n let instFuncs = instFuncTable[className] = (instFuncTable[className] || objCreate(null)); // fetch and assign if as it may not exist yet\n\n // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable\n if (instFuncTable[DynAllowInstChkTag] !== false) {\n instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;\n }\n\n if (!_isObjectOrArrayPrototype(instFuncs)) {\n _forEachProp(target, (name) => {\n // Only add overridden functions\n if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name] ) {\n // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function\n instFuncs[name] = target[name];\n try {\n delete target[name];\n } catch (e) {\n // Ignore errors in restricted environments like Cloudflare Workers\n }\n \n // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one\n if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {\n proto[name] = _createDynamicPrototype(proto, name);\n }\n }\n });\n }\n }\n }\n}\n\n/**\n * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance\n * @param classProto The class prototype instance\n * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy\n * @ignore\n */\nfunction _checkPrototype(classProto:any, thisTarget:any) {\n // This method doesn't existing in older browsers (e.g. IE8)\n if (_objGetPrototypeOf) {\n // As this is primarily a coding time check, don't bother checking if running in IE8 or lower\n let visited:any[] = [];\n let thisProto = _getObjProto(thisTarget);\n while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {\n if (thisProto === classProto) {\n return true;\n }\n\n // This avoids the caller from needing to check whether it's direct base class implements the function or not\n // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes.\n visited.push(thisProto);\n thisProto = _getObjProto(thisProto);\n }\n\n return false;\n }\n\n // If objGetPrototypeOf doesn't exist then just assume everything is ok.\n return true;\n}\n\n/**\n * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name.\n * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only.\n * @param target \n * @param unknownValue \n * @ignore\n */\nfunction _getObjName(target:any, unknownValue?:string) {\n if (objHasOwnProperty(target, Prototype)) {\n // Look like a prototype\n return target.name || unknownValue || UnknownValue\n }\n\n return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;\n}\n\n/**\n * Interface to define additional configuration options to control how the dynamic prototype functions operate.\n */\nexport interface IDynamicProtoOpts {\n\n /**\n * Should the dynamic prototype attempt to set an instance function for instances that do not already have an\n * function of the same name or have been extended by a class with a (non-dynamic proto) prototype function.\n */\n setInstFuncs: boolean,\n\n /**\n * When looking for base (super) functions if it finds a dynamic proto instances can it use the instance functions\n * and bypass the prototype lookups. Defaults to true.\n */\n useBaseInst?: boolean\n}\n\n/**\n * The delegate signature for the function used as the callback for dynamicProto() \n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid for the proxy instance, even \n * though it is only a proxy that only contains the functions \n * @param theTarget This is the real \"this\" of the current target object\n * @param baseFuncProxy The is a proxy object which ONLY contains this function that existed on the \"this\" instance before\n * calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the \"super\" keyword.\n */\nexport type DynamicProtoDelegate = (theTarget:DPType, baseFuncProxy?:DPType) => void;\n\n/**\n * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-\n * - Saves references to all defined base class functions\n * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all \"super\" functions.\n * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance.\n * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is \n * passed both the target \"this\" and an object that can be used to call any base (super) functions, using this based object in place of\n * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct \"this\"\n * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions\n * defined in the constructor or some other function (rather than declared as complete typescript functions).\n * ### Usage\n * ```typescript\n * import dynamicProto from \"@microsoft/dynamicproto-js\";\n * class ExampleClass extends BaseClass {\n * constructor() {\n * dynamicProto(ExampleClass, this, (_self, base) => {\n * // This will define a function that will be converted to a prototype function\n * _self.newFunc = () => {\n * // Access any \"this\" instance property \n * if (_self.someProperty) {\n * ...\n * }\n * }\n * // This will define a function that will be converted to a prototype function\n * _self.myFunction = () => {\n * // Access any \"this\" instance property\n * if (_self.someProperty) {\n * // Call the base version of the function that we are overriding\n * base.myFunction();\n * }\n * ...\n * }\n * _self.initialize = () => {\n * ...\n * }\n * // Warnings: While the following will work as _self is simply a reference to\n * // this, if anyone overrides myFunction() the overridden will be called first\n * // as the normal JavaScript method resolution will occur and the defined\n * // _self.initialize() function is actually gets removed from the instance and\n * // a proxy prototype version is created to reference the created method.\n * _self.initialize();\n * });\n * }\n * }\n * ```\n * @typeparam DPType This is the generic type of the class, used to keep intellisense valid\n * @typeparam DPCls The type that contains the prototype of the current class\n * @param theClass - This is the current class instance which contains the prototype for the current class\n * @param target - The current \"this\" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.\n * @param delegateFunc - The callback function (closure) that will create the dynamic function\n * @param options - Additional options to configure how the dynamic prototype operates\n */\nexport default function dynamicProto(theClass:DPCls, target:DPType, delegateFunc: DynamicProtoDelegate, options?:IDynamicProtoOpts): void {\n // Make sure that the passed theClass argument looks correct\n if (!objHasOwnProperty(theClass, Prototype)) {\n _throwTypeError(\"theClass is an invalid class definition.\");\n }\n\n // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error)\n let classProto = theClass[Prototype];\n if (!_checkPrototype(classProto, target)) {\n _throwTypeError(\"[\" + _getObjName(theClass) + \"] not in hierarchy of [\" + _getObjName(target) + \"]\");\n }\n\n let className = null;\n if (objHasOwnProperty(classProto, DynClassName)) {\n // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain)\n className = classProto[DynClassName];\n } else {\n // As not all browser support name on the prototype creating a unique dynamic one if we have not already\n // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance\n // function table lookup.\n className = DynClassNamePrefix + _getObjName(theClass, \"_\") + \"$\" + _gblInst.n ;\n _gblInst.n++;\n try {\n classProto[DynClassName] = className;\n } catch (e) {\n // Ignore errors in restricted environments like Cloudflare Workers\n }\n }\n\n let perfOptions = dynamicProto[DynProtoDefaultOptions];\n let useBaseInst = !!perfOptions[strUseBaseInst];\n if (useBaseInst && options && options[strUseBaseInst] !== undefined) {\n useBaseInst = !!options[strUseBaseInst];\n }\n\n // Get the current instance functions\n let instFuncs = _getInstanceFuncs(target);\n\n // Get all of the functions for any base instance (before they are potentially overridden)\n let baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);\n\n // Execute the delegate passing in both the current target \"this\" and \"base\" function references\n // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support\n delegateFunc(target, baseFuncs as DPType);\n\n // Don't allow setting instance functions in older browsers or restricted environments\n let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isRestrictedEnvironment();\n if (setInstanceFunc && options) {\n setInstanceFunc = !!options[strSetInstFuncs];\n }\n\n // Populate the Prototype for any overridden instance functions\n _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);\n}\n\n/**\n * Exposes the default global options to allow global configuration, if the global values are disabled these will override\n * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose\n * their internal usage of dynamic proto.\n */\ndynamicProto[DynProtoDefaultOptions] = _gblInst.o;\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritTest3 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritTest4 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritTest5 extends InheritTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritTest2 extends InheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest3 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritTest6 extends DynInheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritTest4 extends InheritTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest5 extends DynInheritTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritTest6 extends DynInheritTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInherit1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInherit2 extends InheritTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritTest7 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInherit3 extends DynInheritTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritTest8 extends InstInherit3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest9 extends BadInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTest9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit1 extends InstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTest10 extends GoodInstInherit1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTest10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInherit2 extends DynInheritTest10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoDefaultTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"Default: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInherit1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInherit2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInherit3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInherit1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTest9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInherit1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTest10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInherit2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritMultipleCallTest3 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritMultipleCallTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest4 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritMultipleCallTest5 extends InheritMultipleCallTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest2 extends InheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritMultipleCallTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest3 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritMultipleCallTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n });\n }\n}\n\nclass InheritMultipleCallTest6 extends DynInheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest4 extends InheritMultipleCallTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritMultipleCallTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest5 extends DynInheritMultipleCallTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritMultipleCallTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n });\n }\n}\n\nclass DynInheritMultipleCallTest6 extends DynInheritMultipleCallTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritMultipleCallTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritMultipleCall2 extends InheritMultipleCallTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritMultipleCallTest7 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritMultipleCallTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritMultipleCall3 extends DynInheritMultipleCallTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritMultipleCallTest8 extends InstInheritMultipleCall3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritMultipleCallTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n });\n }\n}\n\nclass BadInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall9 extends BadInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestMultipleCall9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall1 extends InstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestMultipleCall10 extends GoodInstInheritMultipleCall1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestMultipleCall10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n });\n }\n}\n\nclass GoodInstInheritMultipleCall2 extends DynInheritTestMultipleCall10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleCallTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"MultipleCall: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritMultipleCallTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritMultipleCallTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritMultipleCallTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritMultipleCallTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritMultipleCallTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritMultipleCallTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritMultipleCallTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritMultipleCallTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritMultipleCallTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritMultipleCall2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritMultipleCallTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritMultipleCallTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritMultipleCall3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritMultipleCallTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestMultipleCall9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritMultipleCall1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestMultipleCall10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritMultipleCall2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n ]);\n }\n });\n }\n}\n","/// \n\nimport dynamicProto from \"../src/DynamicProto\";\n\ninterface IInheritTest {\n executionOrder:string[];\n testFunction?(): void;\n}\n\nclass InheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n constructor() {\n this.executionOrder.push(\"InheritTest1()\");\n }\n\n public testFunction() {\n this.executionOrder.push(\"InheritTest1.test()\");\n }\n}\n\nclass InheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest2()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest2.test()\");\n }\n}\n\nclass InheritNoInstTest3 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest3()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest3.test()\");\n }\n}\n\nclass DynInheritNoInstTest1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?(): void;\n\n constructor() {\n this.executionOrder.push(\"DynInheritTest1()\");\n dynamicProto(DynInheritNoInstTest1, this, (_self, base) => {\n _self.testFunction = () => {\n this.executionOrder.push(\"DynInheritTest1.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest4 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest4()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest4.test()\");\n }\n}\n\nclass InheritNoInstTest5 extends InheritNoInstTest4 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest5()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest5.test()\");\n }\n}\n\nclass DynInheritNoInstTest2 extends InheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest2()\");\n dynamicProto(DynInheritNoInstTest2, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest2.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest3 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest3()\");\n dynamicProto(DynInheritNoInstTest3, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest3.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InheritNoInstTest6 extends DynInheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest6()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest6.test()\");\n }\n}\n\nclass DynInheritNoInstTest4 extends InheritNoInstTest6 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest4()\");\n dynamicProto(DynInheritNoInstTest4, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest4.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest5 extends DynInheritNoInstTest1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest5()\");\n dynamicProto(DynInheritNoInstTest5, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest5.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass DynInheritNoInstTest6 extends DynInheritNoInstTest5 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest6()\");\n dynamicProto(DynInheritNoInstTest6, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest6.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass InstInheritNoInst1 implements IInheritTest {\n public executionOrder:string[] = [];\n\n public testFunction?():void;\n\n constructor() {\n this.executionOrder.push(\"InstInherit1()\");\n\n this.testFunction = () => {\n this.executionOrder.push(\"InstInherit1.test()\");\n }\n }\n}\n\nclass InstInheritNoInst2 extends InheritNoInstTest2 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit2()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit2.test()\");\n }\n }\n}\n\nclass InheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"InheritTest7()\");\n }\n\n public testFunction() {\n super.testFunction();\n this.executionOrder.push(\"InheritTest7.test()\");\n }\n}\n\nclass DynInheritNoInstTest7 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest7()\");\n dynamicProto(DynInheritNoInstTest7, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest7.test()\");\n }\n });\n }\n}\n\nclass InstInheritNoInst3 extends DynInheritNoInstTest7 {\n constructor() {\n super();\n this.executionOrder.push(\"InstInherit3()\");\n\n this.testFunction = () => {\n super.testFunction();\n this.executionOrder.push(\"InstInherit3.test()\");\n }\n }\n}\n\nclass DynInheritNoInstTest8 extends InstInheritNoInst3 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest8()\");\n dynamicProto(DynInheritNoInstTest8, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest8.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass BadInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"BadInstInherit1()\");\n\n this.testFunction = () => {\n try {\n super.testFunction();\n } catch (e) {\n this.executionOrder.push(\"BadInstInherit1.throw()\");\n }\n this.executionOrder.push(\"BadInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst9 extends BadInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest9()\");\n dynamicProto(DynInheritTestNoInst9, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest9.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst1 extends InstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit1()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit1.test()\");\n }\n }\n}\n\nclass DynInheritTestNoInst10 extends GoodInstInheritNoInst1 {\n constructor() {\n super();\n this.executionOrder.push(\"DynInheritTest10()\");\n dynamicProto(DynInheritTestNoInst10, this, (_self, base) => {\n _self.testFunction = () => {\n base.testFunction();\n this.executionOrder.push(\"DynInheritTest10.test()\");\n }\n }, { setInstFuncs: false });\n }\n}\n\nclass GoodInstInheritNoInst2 extends DynInheritTestNoInst10 {\n constructor() {\n super();\n this.executionOrder.push(\"GoodInstInherit2()\");\n\n let prevTestFunc = this.testFunction;\n this.testFunction = () => {\n prevTestFunc.call(this);\n this.executionOrder.push(\"GoodInstInherit2.test()\");\n }\n }\n}\n\nexport class DynamicProtoMultipleNoInstTests extends TestClass {\n\n public testInitialize() {\n }\n\n private _validateOrder(message:string, actual:string[], expected:string[]) {\n QUnit.assert.equal(actual.length, expected.length, message + \": Checking the length\");\n\n let passed = true;\n let error = \"\";\n for (let lp = 0; lp < expected.length; lp++) {\n if (lp < actual.length) {\n if (actual[lp] !== expected[lp]) {\n passed = false\n error += \" **[\" + actual[lp] + \"!=\" + expected[lp] + \"]**;\"\n } else {\n error += \" \" + expected[lp] + \";\";\n }\n } else {\n passed = false;\n error += \" --[\" + expected[lp] + \"]--;\"\n }\n }\n\n // Fail test and log any extra unexpected calls\n for (let lp = expected.length; lp < actual.length; lp++) {\n passed = false;\n error += \" ++[\" + actual[lp] + \"]++;\"\n }\n\n QUnit.assert.ok(passed, message + \":\" + error);\n }\n\n private doTest(message:string, theTest:IInheritTest, expectedOrder:string[])\n {\n theTest.testFunction();\n theTest.testFunction();\n this._validateOrder(message, theTest.executionOrder, expectedOrder);\n }\n\n public registerTests() {\n this.testCase({\n name: \"NoInst: Inheritance tests\",\n test: () => {\n this.doTest(\"InheritTest1\", new InheritNoInstTest1(), [\n \"InheritTest1()\", \n \"InheritTest1.test()\",\n \"InheritTest1.test()\"\n ]);\n\n this.doTest(\"InheritTest2\", new InheritNoInstTest2(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\"\n ]);\n\n this.doTest(\"InheritTest3\", new InheritNoInstTest3(), [\n \"InheritTest1()\", \n \"InheritTest2()\", \n \"InheritTest3()\", \n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest4\", new InheritNoInstTest4(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\"\n ]);\n\n this.doTest(\"InheritTest5\", new InheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"InheritTest4()\", \n \"InheritTest5()\", \n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"InheritTest4.test()\",\n \"InheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest1\", new DynInheritNoInstTest1(), [\n \"DynInheritTest1()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest2\", new DynInheritNoInstTest2(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\"\n ]);\n\n this.doTest(\"DynInheritTest3\", new DynInheritNoInstTest3(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"DynInheritTest3()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"DynInheritTest3.test()\"\n ]);\n\n this.doTest(\"InheritTest6\", new InheritNoInstTest6(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\"\n ]);\n\n this.doTest(\"DynInheritTest4\", new DynInheritNoInstTest4(), [\n \"InheritTest1()\", \n \"DynInheritTest2()\", \n \"InheritTest6()\", \n \"DynInheritTest4()\", \n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\",\n \"InheritTest1.test()\",\n \"DynInheritTest2.test()\",\n \"InheritTest6.test()\",\n \"DynInheritTest4.test()\"\n ]);\n\n this.doTest(\"DynInheritTest5\", new DynInheritNoInstTest5(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\"\n ]);\n\n this.doTest(\"DynInheritTest6\", new DynInheritNoInstTest6(), [\n \"DynInheritTest1()\", \n \"DynInheritTest5()\", \n \"DynInheritTest6()\", \n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\",\n \"DynInheritTest1.test()\",\n \"DynInheritTest5.test()\",\n \"DynInheritTest6.test()\"\n ]);\n\n\n this.doTest(\"InstInherit1\", new InstInheritNoInst1(), [\n \"InstInherit1()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n this.doTest(\"InstInherit2\", new InstInheritNoInst2(), [\n \"InheritTest1()\",\n \"InheritTest2()\", \n \"InstInherit2()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\",\n \"InheritTest1.test()\",\n \"InheritTest2.test()\",\n \"InstInherit2.test()\"\n ]);\n\n // NOTE: Notice that InheritTest7.test() was not called -- this is because TS doesn't handle this\n this.doTest(\"InheritTest7\", new InheritNoInstTest7(), [\n \"InstInherit1()\",\n \"InheritTest7()\", \n \"InstInherit1.test()\",\n \"InstInherit1.test()\"\n ]);\n\n // NOTE: Notice that DynInheritTest7.test() IS called -- this is because dynamicProto handles this scenario\n this.doTest(\"DynInheritTest7\", new DynInheritNoInstTest7(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\"\n ]);\n\n this.doTest(\"InstInherit3\", new InstInheritNoInst3(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\"\n ]);\n \n this.doTest(\"DynInheritTest8\", new DynInheritNoInstTest8(), [\n \"InstInherit1()\", \n \"DynInheritTest7()\", \n \"InstInherit3()\", \n \"DynInheritTest8()\", \n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\",\n \"InstInherit1.test()\",\n \"DynInheritTest7.test()\",\n \"InstInherit3.test()\",\n \"DynInheritTest8.test()\"\n ]);\n \n // Note: Bad inherit as with InheritTest7 fails to call base instance and actually throws in this case\n this.doTest(\"BadInstInherit1\", new BadInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\"\n ]);\n\n // Note: dynamicProto doesn't fix broken base classes, but it still calls them in the correct order\n this.doTest(\"DynInheritTest9\", new DynInheritTestNoInst9(), [\n \"InstInherit1()\", \n \"BadInstInherit1()\",\n \"DynInheritTest9()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\",\n \"BadInstInherit1.throw()\",\n \"BadInstInherit1.test()\",\n \"DynInheritTest9.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit1\", new GoodInstInheritNoInst1(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\", \n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\"\n ]);\n\n this.doTest(\"DynInheritTest10\", new DynInheritTestNoInst10(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\"\n ]);\n\n this.doTest(\"GoodInstInherit2\", new GoodInstInheritNoInst2(), [\n \"InstInherit1()\", \n \"GoodInstInherit1()\",\n \"DynInheritTest10()\",\n \"GoodInstInherit2()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\",\n \"InstInherit1.test()\",\n \"GoodInstInherit1.test()\",\n \"DynInheritTest10.test()\",\n \"GoodInstInherit2.test()\"\n ]);\n }\n });\n }\n}\n","/// \n\nimport { objGetPrototypeOf } from \"@nevware21/ts-utils\";\nimport dynamicProto from \"../src/DynamicProto\";\n\nclass HackClass {\n public hello: string;\n\n constructor() {\n this.hello = \"world\";\n }\n}\n\n\nclass BadInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = Object.prototype;\n }\n}\n\nclass BadProxyInstClass {\n public _dynInstFuncs: any = {};\n\n constructor() {\n this._dynInstFuncs = new Proxy(this, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n }\n}\n\nexport class SecurityCheckTests extends TestClass {\n\n public testInitialize() {\n }\n\n public registerTests() {\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object.prototype, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype directly\",\n test: () => {\n let a: any = {};\n\n try {\n dynamicProto(Object, a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self.__proto__ = () => {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ property\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly using defineProperty with a HackClass instance and __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n Object.defineProperty(self, \"__proto__\", {\n value: () => {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype using HackClass instance with a __proto__ function\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n \n self.__proto__ = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n };\n\n self.prototype = {\n testHack2: true\n };\n\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n self.__proto__ = {\n testHack: true\n };\n \n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with HackClass and an object instance\",\n test: () => {\n let a = {};\n\n try {\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n \n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n \n self.prototype = {\n testHack2: true\n };\n });\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n QUnit.assert.ok(e.message.indexOf(\"not in hierarchy\") > -1, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self[\"__proto__['hacked']\"] = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with evil __proto__ with HackClass and an object instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__['hacked']\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype directly with a HackClass instance\",\n test: () => {\n let a = new HackClass()\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n self.__proto__ = {\n testHack: true\n };\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly using defineProperty with a HackClass instance\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let self = _self;\n self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n\n Object.defineProperty(self, \"__proto__\", {\n value: {\n testHack: true\n },\n configurable: true,\n enumerable: true\n });\n\n self.prototype = {\n testHack2: true\n };\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with a null prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n\n try {\n dynamicProto(theInstance, a, (_self, base) => {\n _self.__proto__ = {\n testHack: true\n };\n\n _self.prototype = {\n testHack2: true\n };\n\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack2\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly with an a prototype instance\",\n test: () => {\n let a: any = {};\n let theInstance = Object.create(a);\n try {\n dynamicProto(Object.getPrototypeOf(theInstance), a, (_self, base) => {\n _self._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Object.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Object.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype indirectly by using a HackClass and updating the base class prototype\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n try {\n objGetPrototypeOf(base).testHack = true;\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n } catch (e) {\n QUnit.assert.ok(true, \"Expected an exception to be thrown\");\n }\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"testHack\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Array.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n _self[\"_dynInstFuncs\"] = new Proxy(_self[\"_dynInstFuncs\"] || {}, {\n get: (target, prop) => {\n if (typeof prop === \"string\" && prop.startsWith(\"_dynCls\")) {\n return Array.prototype;\n }\n\n return target[prop];\n }\n });\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Array.prototype indirectly by using a proxy to return the Object.prototype as the instance functions\",\n test: () => {\n let a = new HackClass();\n\n dynamicProto(HackClass, a, (_self, base) => {\n let className = _self[\"_dynClass\"];\n let classProto = _self[\"_dynInstFuncs\"] = (_self[\"_dynInstFuncs\"] || {});\n\n // Change the return class prototype to be Object.prototype\n classProto[\"_dynCls\" + className] = Array.prototype;\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Array.prototype\");\n }\n });\n\n QUnit.assert.ok(!Array.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Array.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadInstClass instance\",\n test: () => {\n let a = new BadInstClass();\n\n dynamicProto(BadInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n this.testCase({\n name: \"Try to update Object.prototype with a BadProxyInstClass instance\",\n test: () => {\n let a = new BadProxyInstClass();\n\n dynamicProto(BadProxyInstClass, a, (_self, base) => {\n\n (_self as any)._testFunction = () => {\n QUnit.assert.fail(\"Should not be able to update Object.prototype\");\n }\n });\n\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_testFunction\"), \"Should not have polluted Object.prototype\");\n QUnit.assert.ok(!Object.prototype.hasOwnProperty(\"_dynInstFuncs\"), \"Should not have polluted Object.prototype\");\n }\n });\n\n }\n}\n\n","import { DynamicProtoDefaultTests } from '../DynamicProto.Tests';\nimport { DynamicProtoMultipleCallTests } from '../DynamicProtoMultipleCall.Tests';\nimport { DynamicProtoNoInstTests } from '../DynamicProtoNoInst.Tests';\nimport { DynamicProtoMultipleNoInstTests } from '../DynamicProtoMultipleNoInst.Tests';\nimport { SecurityCheckTests } from '../SecurityCheck.Tests';\n\nexport function runTests() {\n new DynamicProtoDefaultTests(\"Default\").registerTests();\n new DynamicProtoMultipleCallTests(\"Multiple\").registerTests();\n new DynamicProtoNoInstTests(\"SetInst\").registerTests();\n new DynamicProtoMultipleNoInstTests(\"Multiple SetInst\").registerTests();\n new SecurityCheckTests(\"Security Checks\").registerTests();\n}\n"]} \ No newline at end of file From 3e1905a359daa3266c2b3cd32011423c7d9b54cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 19:31:27 +0000 Subject: [PATCH 17/22] Replace Object.defineProperty with alternative property operations Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 29 +- .../Selenium/dynamicprotorolluptests.d.ts | 214 ++++ .../test/Selenium/dynamicprotorolluptests.js | 1107 +++++++++++++++++ .../Selenium/dynamicprotorolluptests.js.map | 1 + 4 files changed, 1337 insertions(+), 14 deletions(-) create mode 100644 rollup/test/Selenium/dynamicprotorolluptests.d.ts create mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js create mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js.map diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index c29f651..1438259 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -26,24 +26,25 @@ interface DynamicGlobalSettings { */ function _isRestrictedEnvironment(): boolean { try { - // Test if we can perform property definition/redefinition - // This specifically targets restricted environments like Cloudflare Workers - // where property redefinition causes errors + // Test if we can perform basic property operations that would be restricted + // in environments like Cloudflare Workers using operations similar to what the library does let testObj = {}; - let testProp = "testProperty"; - Object.defineProperty(testObj, testProp, { - configurable: true, - value: 1 - }); - Object.defineProperty(testObj, testProp, { - configurable: true, - value: 2 - }); + let testFunc = function() { return "test"; }; + let testProp = "_dynTestProp"; + + // Try to set a property (similar to how we set dynamic properties) + testObj[testProp] = 1; + + // Try to set a property on a function (similar to tagging functions) + testFunc[testProp] = 1; + + // Try to delete the property (similar to removing instance methods) + delete testObj[testProp]; - // If we can redefine properties, not a restricted environment + // If all operations succeed, not a restricted environment return false; } catch (e) { - // If property redefinition fails, we're in a restricted environment + // If any operation fails, we're in a restricted environment return true; } } diff --git a/rollup/test/Selenium/dynamicprotorolluptests.d.ts b/rollup/test/Selenium/dynamicprotorolluptests.d.ts new file mode 100644 index 0000000..76808f3 --- /dev/null +++ b/rollup/test/Selenium/dynamicprotorolluptests.d.ts @@ -0,0 +1,214 @@ +/// +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +declare class Assert { + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static deepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static equal(expected: any, actual: any, message?: string): any; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + static notDeepEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notEqual(expected: any, actual: any, message?: string): any; + static notPropEqual(expected: any, actual: any, message?: string): any; + static propEqual(expected: any, actual: any, message?: string): any; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static notStrictEqual(expected: any, actual: any, message?: string): any; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + static ok(state: any, message?: string): any; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + static strictEqual(expected: any, actual: any, message?: string): any; + /** + * Assertion to test if a callback throws an exception when run. + * + * When testing code that is expected to throw an exception based on a specific set of + * circumstances, use throws() to catch the error object for testing and comparison. + * + * @param block Function to execute + * @param expected Error Object to compare + * @param message A short description of the assertion + */ + static throws(block: () => any, expected: any, message?: string): any; + /** + * @param block Function to execute + * @param message A short description of the assertion + */ + static throws(block: () => any, message?: string): any; +} +/** Defines a test case */ +declare class TestCase { + /** Name to use for the test case */ + name: string; + /** Test case method */ + test: () => void; +} +/** Defines a test case */ +interface TestCaseAsync { + /** Name to use for the test case */ + name: string; + /** time to wait after pre before invoking post and calling start() */ + stepDelay: number; + /** async steps */ + steps: Array<() => void>; +} +declare class TestClass { + constructor(name?: string); + static isPollingStepFlag: string; + /** The instance of the currently running suite. */ + static currentTestClass: TestClass; + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + useFakeTimers: boolean; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + useFakeServer: boolean; + /** Method called before the start of each test method */ + testInitialize(): void; + /** Method called after each test method has completed */ + testCleanup(): void; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + registerTests(): void; + /** Register an async Javascript unit testcase. */ + testCaseAsync(testInfo: TestCaseAsync): void; + /** Register a Javascript unit testcase. */ + testCase(testInfo: TestCase): void; + /** Called when the test is starting. */ + private _testStarting; + /** Called when the test is completed. */ + private _testCompleted; + /**** Sinon methods and properties ***/ + clock: SinonFakeTimers; + server: SinonFakeServer; + sandbox: SinonSandbox; + /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ + spy(): SinonSpy; + /** Spies on the provided function */ + spy(funcToWrap: Function): SinonSpy; + /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ + spy(object: any, methodName: string, func?: Function): SinonSpy; + /** Creates an anonymous stub function. */ + stub(): SinonStub; + /** Stubs all the object's methods. */ + stub(object: any): SinonStub; + /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ + stub(object: any, methodName: string, func?: Function): SinonStub; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + mock(object: any): SinonMock; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; + protected setUserAgent(userAgent: string): void; +} +declare module "src/removeDynamic" { + export interface IDynamicProtoRollupOptions { + tagname?: string; + comment?: string; + sourcemap?: boolean; + } + /** + * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to + * remove the boilerplate code require by typescript to define methods as prototype level while + * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" + * functions from the production code. + */ + export default function dynamicRemove(options?: IDynamicProtoRollupOptions): { + name: string; + renderChunk(code: string, chunk: any): any; + transform: (code: string, id: string) => any; + }; +} +declare module "test/DynamicProtoRollup.Tests" { + export class DynamicProtoRollupTests extends TestClass { + testInitialize(): void; + private visibleNewlines; + private convertNewlines; + private testNoChange; + private doTest; + private testExpected; + private testError; + registerTests(): void; + } +} +declare module "test/Selenium/DynamicProtoRollupTests" { + export function runTests(): void; +} diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js b/rollup/test/Selenium/dynamicprotorolluptests.js new file mode 100644 index 0000000..c9dab61 --- /dev/null +++ b/rollup/test/Selenium/dynamicprotorolluptests.js @@ -0,0 +1,1107 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/// +/** + * Wrapper around QUnit asserts. This class has two purposes: + * - Make Assertion methods easy to discover. + * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. + */ +var Assert = /** @class */ (function () { + function Assert() { + } + /** + * A deep recursive comparison assertion, working on primitive types, arrays, objects, + * regular expressions, dates and functions. + * + * The deepEqual() assertion can be used just like equal() when comparing the value of + * objects, such that { key: value } is equal to { key: value }. For non-scalar values, + * identity will be disregarded by deepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.deepEqual = function (expected, actual, message) { + return deepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. + * + * The equal assertion uses the simple comparison operator (==) to compare the actual + * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. + * When it fails, both actual and expected values are displayed in the test result, + * in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.equal = function (expected, actual, message) { + return equal(actual, expected, message); + }; + /** + * An inverted deep recursive comparison assertion, working on primitive types, + * arrays, objects, regular expressions, dates and functions. + * + * The notDeepEqual() assertion can be used just like equal() when comparing the + * value of objects, such that { key: value } is equal to { key: value }. For non-scalar + * values, identity will be disregarded by notDeepEqual. + * + * @param expected Known comparison value + * @param actual Object or Expression being tested + * @param message A short description of the assertion + */ + Assert.notDeepEqual = function (expected, actual, message) { + return notDeepEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notEqual assertion uses the simple inverted comparison operator (!=) to compare + * the actual and expected arguments. When they aren't equal, the assertion passes: any; + * otherwise, it fails. When it fails, both actual and expected values are displayed + * in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notEqual = function (expected, actual, message) { + return notEqual(actual, expected, message); + }; + Assert.notPropEqual = function (expected, actual, message) { + return notPropEqual(actual, expected, message); + }; + Assert.propEqual = function (expected, actual, message) { + return propEqual(actual, expected, message); + }; + /** + * A non-strict comparison assertion, checking for inequality. + * + * The notStrictEqual assertion uses the strict inverted comparison operator (!==) + * to compare the actual and expected arguments. When they aren't equal, the assertion + * passes: any; otherwise, it fails. When it fails, both actual and expected values are + * displayed in the test result, in addition to a given message. + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.notStrictEqual = function (expected, actual, message) { + return notStrictEqual(actual, expected, message); + }; + /** + * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). + * Passes if the first argument is truthy. + * + * The most basic assertion in QUnit, ok() requires just one argument. If the argument + * evaluates to true, the assertion passes; otherwise, it fails. If a second message + * argument is provided, it will be displayed in place of the result. + * + * @param state Expression being tested + * @param message A short description of the assertion + */ + Assert.ok = function (state, message) { + return ok(state, message); + }; + /** + * A strict type and value comparison assertion. + * + * The strictEqual() assertion provides the most rigid comparison of type and value with + * the strict equality operator (===) + * + * @param expected Known comparison value + * @param actual Expression being tested + * @param message A short description of the assertion + */ + Assert.strictEqual = function (expected, actual, message) { + return strictEqual(actual, expected, message); + }; + Assert.throws = function (block, expected, message) { + return throws(block, expected, message); + }; + return Assert; +}()); +/** Defines a test case */ +var TestCase = /** @class */ (function () { + function TestCase() { + } + return TestCase; +}()); +/// +/// +/// +/// +var TestClass = /** @class */ (function () { + function TestClass(name) { + /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ + this.useFakeTimers = true; + /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ + this.useFakeServer = true; + QUnit.module(name); + } + /** Method called before the start of each test method */ + TestClass.prototype.testInitialize = function () { + }; + /** Method called after each test method has completed */ + TestClass.prototype.testCleanup = function () { + }; + /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ + TestClass.prototype.registerTests = function () { + }; + /** Register an async Javascript unit testcase. */ + TestClass.prototype.testCaseAsync = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (isNaN(testInfo.stepDelay)) { + throw new Error("Must specify 'stepDelay' period between pre and post"); + } + if (!testInfo.steps) { + throw new Error("Must specify 'steps' to take asynchronously"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function (assert) { + var done = assert.async(); + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + var steps_1 = testInfo.steps; + var trigger_1 = function () { + if (steps_1.length) { + var step = steps_1.shift(); + // The callback which activates the next test step. + var nextTestStepTrigger = function () { + setTimeout(function () { + trigger_1(); + }, testInfo.stepDelay); + }; + // There 2 types of test steps - simple and polling. + // Upon completion of the simple test step the next test step will be called. + // In case of polling test step the next test step is passed to the polling test step, and + // it is responsibility of the polling test step to call the next test step. + try { + if (step[TestClass.isPollingStepFlag]) { + step.call(_this, nextTestStepTrigger); + } + else { + step.call(_this); + nextTestStepTrigger.call(_this); + } + } + catch (e) { + _this._testCompleted(); + Assert.ok(false, e.toString()); + // done is QUnit callback indicating the end of the test + done(); + return; + } + } + else { + _this._testCompleted(); + // done is QUnit callback indicating the end of the test + done(); + } + }; + trigger_1(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + // done is QUnit callback indicating the end of the test + done(); + } + }; + // Register the test with QUnit + QUnit.test(testInfo.name, testMethod); + }; + /** Register a Javascript unit testcase. */ + TestClass.prototype.testCase = function (testInfo) { + var _this = this; + if (!testInfo.name) { + throw new Error("Must specify name in testInfo context in registerTestcase call"); + } + if (!testInfo.test) { + throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); + } + // Create a wrapper around the test method so we can do test initilization and cleanup. + var testMethod = function () { + // Save off the instance of the currently running suite. + TestClass.currentTestClass = _this; + // Run the test. + try { + _this._testStarting(); + testInfo.test.call(_this); + _this._testCompleted(); + } + catch (ex) { + Assert.ok(false, "Unexpected Exception: " + ex); + _this._testCompleted(true); + } + }; + // Register the test with QUnit + test(testInfo.name, testMethod); + }; + /** Called when the test is starting. */ + TestClass.prototype._testStarting = function () { + // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. + var config = sinon.getConfig(sinon.config); + config.useFakeTimers = this.useFakeTimers; + config.useFakeServer = this.useFakeServer; + config.injectInto = config.injectIntoThis && this || config.injectInto; + this.sandbox = sinon.sandbox.create(config); + this.server = this.sandbox.server; + // Allow the derived class to perform test initialization. + this.testInitialize(); + }; + /** Called when the test is completed. */ + TestClass.prototype._testCompleted = function (failed) { + if (failed) { + // Just cleanup the sandbox since the test has already failed. + this.sandbox.restore(); + } + else { + // Verify the sandbox and restore. + this.sandbox.verifyAndRestore(); + } + this.testCleanup(); + // Clear the instance of the currently running suite. + TestClass.currentTestClass = null; + }; + TestClass.prototype.spy = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + TestClass.prototype.stub = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return null; + }; + /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ + TestClass.prototype.mock = function (object) { return null; }; + /**** end: Sinon methods and properties ***/ + /** Sends a JSON response to the provided request. + * @param request The request to respond to. + * @param data Data to respond with. + * @param errorCode Optional error code to send with the request, default is 200 + */ + TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { + if (errorCode === undefined) { + errorCode = 200; + } + request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); + }; + TestClass.prototype.setUserAgent = function (userAgent) { + Object.defineProperty(window.navigator, 'userAgent', { + configurable: true, + get: function () { + return userAgent; + } + }); + }; + TestClass.isPollingStepFlag = "isPollingStep"; + return TestClass; +}()); +// Configure Sinon +sinon.assert.fail = function (msg) { + Assert.ok(false, msg); +}; +sinon.assert.pass = function (assertion) { + Assert.ok(assertion, "sinon assert"); +}; +sinon.config = { + injectIntoThis: true, + injectInto: null, + properties: ["spy", "stub", "mock", "clock", "sandbox"], + useFakeTimers: true, + useFakeServer: true +}; +/// +/// +/// +/// +/// +define("src/removeDynamic", ["require", "exports", "magic-string"], function (require, exports, magic_string_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + ; + function escape(str) { + return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); + } + function isSourceMapEnabled(options) { + if (options) { + return options.sourceMap !== false && options.sourcemap !== false; + } + return false; + } + // Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always + // exists in the build / test infrastructure + function padEnd(input, len, fill) { + var value = input || ""; + while (value.length < len) { + value += fill; + } + if (value.length > len) { + value = value.substring(0, len); + } + return value; + } + function isNullOrWhitespace(value) { + if (value) { + return value.replace(/\s/g, "").length < 1; + } + return true; + } + /** + * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to + * remove the boilerplate code require by typescript to define methods as prototype level while + * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" + * functions from the production code. + */ + function dynamicRemove(options) { + if (options === void 0) { options = {}; } + var token = (options || {}).tagname || "@DynamicProtoStub"; + var replaceValue = (options || {}).comment || "// Removed Stub for %function%."; + var tokenGroups = [4, 10, 13]; + var funcNameGroup = 6; + // Because of the test infrastructure (PhamtonJS) the RegEx can't use the "s" flag (gis vs gi) or named groups + var pattern = new RegExp("([\\t ]*\\/\\*\\*((?!\\*\\/)(.|\\r|\\n))*\\*\\/[\\s]*)*(\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*(\\r\\n|\\n\\r|\\r|\\n))*[\\t ]*([\\w]*\\.prototype(\\.|\\[\\\"|\\[\\')[\\w]*(\\\"\\]|\\'\\])?)[\\t ]*=[\\t ]*function[\\t ]*\\([^\\{]*\\{[^\\/\\}\\{]*(\\{[^\\}]*\\}[^\\/\\}\\{]*)*(\\/[\\*\\/][\\t ]*" + escape(token) + "[^\\*\\r\\n]*(\\*\\/)?(\\r\\n|\\n\\r|\\r|\\n))*[^\\}]*\\};([\\t ]*\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*)*", 'gi'); + function formatError(token, code, pos, id) { + var lines = code.split(/(?:\r\n|\n\r|\r|\n)/); + var lineNumber = 0; + var count = pos; + while (count > 0) { + lineNumber++; + count = code.lastIndexOf("\n", count - 1); + } + var column = 0; + var lineStart = code.lastIndexOf("\n", pos); + if (lineStart != -1) { + column = (pos - lineStart); + } + else { + column = pos + 1; + } + var message = "Invalid (Unremoved) token [" + token + "] found on line [" + lineNumber + "], column [" + column + "], position [" + pos + "] - " + (id || "") + "\n"; + var marker = padEnd("", token.length, "^"); + var line = lineNumber - 6; + if (line > 0) { + message += " ...\n"; + } + count = 0; + while (count < 10 && line < lines.length - 1) { + count++; + if (line >= 0) { + var number = padEnd("" + (line + 1), 4, " "); + message += number + ":" + lines[line] + "\n"; + if (line == lineNumber - 1) { + message += padEnd("", column + 4, " ") + marker + "\n"; + } + } + line++; + } + if (line < lines.length - 1) { + message += " ...\n"; + } + var match; + var matchCount = 0; + while ((match = pattern.exec(code))) { + var funcName = match[funcNameGroup]; + if (!isNullOrWhitespace(funcName)) { + if (matchCount == 0) { + message += "\nMatch checks\n"; + } + matchCount++; + if (match[0].length > 0) { + message += "Match " + matchCount + " tag Groups for " + (funcName || "") + "\n"; + message += "--=( Complete Matched Content )=--\n"; + message += match[0]; + message += "\n--------------------------------\n"; + for (var lp = 1; lp < match.length; lp++) { + if (match[lp]) { + message += "" + lp + ": " + (match[lp] || "").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); + if ((match[lp] || "").indexOf(token) != -1) { + message += " <- Contains tag"; + } + message += "\n"; + } + } + message += "\n"; + } + } + } + return message; + } + function replaceToken(code, theString) { + var result = false; + var match; + while ((match = pattern.exec(code))) { + var funcName = match[funcNameGroup]; + if (!isNullOrWhitespace(funcName)) { + // Only remove matches that contain a tag and function + var hasToken = false; + for (var lp = 0; lp < tokenGroups.length; lp++) { + if ((match[tokenGroups[lp]] || "").indexOf(token) != -1) { + hasToken = true; + break; + } + } + if (hasToken) { + result = true; + var start_1 = match.index; + var newValue = replaceValue.replace("%function%", funcName); + theString.overwrite(start_1, start_1 + match[0].length, newValue); + } + } + } + return result; + } + function checkResult(result, id) { + if (result) { + var pos = result.indexOf(token); + if (pos != -1) { + throw new Error(formatError(token, result, pos, id)); + } + } + } + function doTransform(code, id) { + var theString = new magic_string_1.default(code); + if (!replaceToken(code, theString)) { + return null; + } + var result = { code: theString.toString() }; + if (isSourceMapEnabled(options)) { + result.map = theString.generateMap({ hires: true }); + } + return result; + } + function doTransformAndCheck(code, id) { + var result = doTransform(code, id); + if (result) { + // Do a final check of the string + checkResult(result.code, id); + } + else { + // Check that the raw input doesn't include the tag + checkResult(code, id); + } + return result; + } + return { + name: 'dynamicRemove', + renderChunk: function (code, chunk) { + return doTransformAndCheck(code, chunk.filename); + }, + transform: doTransformAndCheck + }; + } + exports.default = dynamicRemove; +}); +/// +define("test/DynamicProtoRollup.Tests", ["require", "exports", "src/removeDynamic"], function (require, exports, removeDynamic_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DynamicProtoRollupTests = void 0; + var DynamicProtoRollupTests = /** @class */ (function (_super) { + __extends(DynamicProtoRollupTests, _super); + function DynamicProtoRollupTests() { + return _super !== null && _super.apply(this, arguments) || this; + } + DynamicProtoRollupTests.prototype.testInitialize = function () { + }; + DynamicProtoRollupTests.prototype.visibleNewlines = function (value) { + if (value) { + return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n"); + } + return value; + }; + DynamicProtoRollupTests.prototype.convertNewlines = function (value, newline) { + if (value) { + return value.replace(/\n/g, newline); + } + return value; + }; + DynamicProtoRollupTests.prototype.testNoChange = function (options, input) { + var plugin = (0, removeDynamic_1.default)(options); + QUnit.assert.equal(plugin.name, "dynamicRemove"); + QUnit.assert.equal(plugin.renderChunk(input, { filename: "test.js" }), null); + QUnit.assert.equal(plugin.transform(input, "testId"), null); + }; + DynamicProtoRollupTests.prototype.doTest = function (options, input, expected) { + this.testExpected(options, input, expected); + this.testExpected(options, this.convertNewlines(input, "\r"), this.convertNewlines(expected, "\r")); + this.testExpected(options, this.convertNewlines(input, "\r\n"), this.convertNewlines(expected, "\r\n")); + this.testExpected(options, this.convertNewlines(input, "\n\r"), this.convertNewlines(expected, "\n\r")); + }; + DynamicProtoRollupTests.prototype.testExpected = function (options, input, expected) { + var plugin = (0, removeDynamic_1.default)(options); + QUnit.assert.equal(plugin.name, "dynamicRemove"); + var result = plugin.renderChunk(input, { filename: "test.js" }); + QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); + result = plugin.transform(input, "testId"); + QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); + }; + DynamicProtoRollupTests.prototype.testError = function (options, message, input, expected) { + var plugin = (0, removeDynamic_1.default)(options); + QUnit.assert.throws(function () { + plugin.renderChunk(input, { filename: "test.js" }); + }, new Error(expected), message); + QUnit.assert.throws(function () { + plugin.transform(input, "test.js"); + }, new Error(expected), message); + }; + DynamicProtoRollupTests.prototype.registerTests = function () { + var _this = this; + this.testCase({ + name: "No matching values for removal", + test: function () { + _this.testNoChange(null, "Nothing removed"); + _this.testNoChange(null, "ClassName.prototype.anotherMethod = function () {\n};\n"); + _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n"); + _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n"); + _this.testNoChange(null, "// @Stub -- Type 1 comment\n" + + "function methodName() {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n"); + _this.testNoChange(null, "function methodName() {\n" + + " // @Stub -- Type 2 single line comment\n" + + "};\n"); + _this.testNoChange(null, "function methodName() {\n" + + " /* @Stub -- Type 2 multiline comment */\n" + + "};\n"); + _this.testNoChange(null, "function methodName() {\n" + + " /* @Stub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n"); + } + }); + this.testCase({ + name: "Basic tag patterns", + test: function () { + _this.doTest(null, "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + + " // @DynamicProtoStub -- Type 2 single line comment\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); + } + }); + this.testCase({ + name: "Mixed tagtype combinations", + test: function () { + _this.doTest(null, + // Input, + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + + " }; // @DynamicProtoStub - Tag type 3\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + + " // @DynamicProtoStub - Tag type 2.1\n" + + " };\n" + + " TestClass.prototype.func5 = function () {\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + + " /* @DynamicProtoStub - Tag type 2.2 */\n" + + " };\n" + + " return TestClass;", + // Expected Value + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + "// Removed Stub for TestClass.prototype.func1.\n" + + "// Removed Stub for TestClass.prototype.func2.\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func4.\n" + + " TestClass.prototype.func5 = function () {\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func6.\n" + + " return TestClass;"); + _this.testExpected(null, + // Input, + " /**\r\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r\n" + + " * @param coreConfig - The core configuration.\r\n" + + " * @param core - The AppInsights core.\r\n" + + " * @param extensions - An array of all the plugins being used.\r\n" + + " */\r\n" + + " // @DynamicProtoStub \r\n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\r\n" + + " };\r\n" + + " /**\r" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r" + + " * @param coreConfig - The core configuration.\r" + + " * @param core - The AppInsights core.\r" + + " * @param extensions - An array of all the plugins being used.\r" + + " */\r" + + " // @DynamicProtoStub \r" + + " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\r" + + " };\r" + + " /**\n\r" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n\r" + + " * @param coreConfig - The core configuration.\n\r" + + " * @param core - The AppInsights core.\n\r" + + " * @param extensions - An array of all the plugins being used.\n\r" + + " */\n\r" + + " // @DynamicProtoStub \n\r" + + " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n\r" + + " };\n\r" + + "", + // Expected Value + "// Removed Stub for TestClass.prototype.func1.\r\n" + + "// Removed Stub for TestClass.prototype.func2.\r" + + "// Removed Stub for TestClass.prototype.func3.\n\r"); + } + }); + this.testCase({ + name: "Stubs with return values", + test: function () { + _this.doTest(null, + // Input, + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + + " return;\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + + " return;\n" + + " }; // @DynamicProtoStub - Tag type 3\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + + " // @DynamicProtoStub - Tag type 2.1\n" + + " return;\n" + + " };\n" + + " TestClass.prototype.func5 = function () {\n" + + " return;\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + + " /* @DynamicProtoStub - Tag type 2.2 */\n" + + " return;\n" + + " };\n" + + " return TestClass;", + // Expected Value + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + "// Removed Stub for TestClass.prototype.func1.\n" + + "// Removed Stub for TestClass.prototype.func2.\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype.func3 = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func4.\n" + + " TestClass.prototype.func5 = function () {\n" + + " return;\n" + + " };\n" + + "// Removed Stub for TestClass.prototype.func6.\n" + + " return TestClass;"); + _this.doTest(null, + // Input, + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + "", + // Expected Value + "// Removed Stub for TestClass.prototype.func1.\n" + + "// Removed Stub for TestClass.prototype.func2.\n" + + "// Removed Stub for TestClass.prototype.func3.\n"); + } + }); + this.testCase({ + name: "Test reserved (ES3) function names", + test: function () { + _this.doTest(null, + // Input, + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " };\n" + + " /**\n" + + " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + + " * @param event - The event that needs to be stored.\n" + + " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + + " * can optionally use this to access the current core instance or define / pass additional information\n" + + " * to later plugins (vs appending items to the telemetry item)\n" + + " */\n" + + " TestClass.prototype[\"catch2\"] = function (evt, itemCtx) {\n" + + " return;\n" + + " }; // @DynamicProtoStub - Tag type 3\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype[\"func3\"] = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + " return TestClass;", + // Expected Value + " /* ================================================================================================================\n" + + " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + + " /*\n" + + "// Removed Stub for TestClass.prototype[\"catch\"].\n" + + "// Removed Stub for TestClass.prototype[\"catch2\"].\n" + + " /**\n" + + " * Hello World\n" + + " */\n" + + " TestClass.prototype[\"func3\"] = function () {\n" + + " // Normal Function\n" + + " return;\n" + + " };\n" + + " return TestClass;"); + _this.doTest(null, + // Input, + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"delete\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype[\"throw\"] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + " /**\n" + + " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + + " * @param coreConfig - The core configuration.\n" + + " * @param core - The AppInsights core.\n" + + " * @param extensions - An array of all the plugins being used.\n" + + " */\n" + + " // @DynamicProtoStub \n" + + " TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\n" + + " throw \"Not Implemented\";\n" + + " };\n" + + "", + // Expected Value + "// Removed Stub for TestClass.prototype[\"catch\"].\n" + + "// Removed Stub for TestClass.prototype[\"delete\"].\n" + + "// Removed Stub for TestClass.prototype[\"throw\"].\n" + + "// Removed Stub for TestClass.prototype['if'].\n"); + } + }); + this.testCase({ + name: "Test unconverted tags from partial conversion", + test: function () { + _this.testError(null, "1 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + + "function methodName() {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + + "1 :// @DynamicProtoStub -- Type 1 comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "2 :function methodName() {\n" + + "3 : // This is a comment for a dynamic proto stub\n" + + "4 :};\n"); + _this.testError(null, "2 -- Type 2 single line comment", "function methodName() {\n" + + " // @DynamicProtoStub -- Type 2 single line comment\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n"); + _this.testError(null, "3 -- Type 2 multiline comment", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n"); + _this.testError(null, "4 -- Type 2 multiline comment (2)", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 : * Continuation of a multi-line comment/\n" + + "4 : */\n" + + "5 :};\n"); + _this.testError(null, "5 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + + "function methodName() {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + + "1 :// @DynamicProtoStub -- Type 1 comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "2 :function methodName() {\n" + + "3 : // This is a comment for a dynamic proto stub\n" + + "4 :};\n" + + "5 :// Removed Stub for ClassName.prototype.methodName.\n"); + _this.testError(null, "6 -- Type 2 single line comment", "function methodName() {\n" + + " // @DynamicProtoStub -- Type 2 single line comment\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n" + + "4 :// Removed Stub for ClassName.prototype.methodName.\n"); + _this.testError(null, "7 -- Type 2 multiline comment */", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 :};\n" + + "4 :// Removed Stub for ClassName.prototype.methodName.\n"); + _this.testError(null, "8 -- Type 2 multiline comment (2)", "function methodName() {\n" + + " /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " * Continuation of a multi-line comment/\n" + + " */\n" + + "};\n" + + "// @DynamicProtoStub -- Type 1 comment\n" + + "ClassName.prototype.methodName = function () {\n" + + " // This is a comment for a dynamic proto stub\n" + + "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + + "1 :function methodName() {\n" + + "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + + " ^^^^^^^^^^^^^^^^^\n" + + "3 : * Continuation of a multi-line comment/\n" + + "4 : */\n" + + "5 :};\n" + + "6 :// Removed Stub for ClassName.prototype.methodName.\n"); + } + }); + this.testCase({ + name: "Test prefixed comment with typescript boilerplate for spread and default arguments", + test: function () { + _this.doTest(null, "/**\n" + + " * This method tells if given durations should be excluded from collection.\n" + + " */\n" + + "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + + " var durations = [];\n" + + " for (var _i = 0; _i < arguments.length; _i++) {\n" + + " durations[_i] = arguments[_i];\n" + + " }\n" + + " // @DynamicProtoStub\n" + + " return true;\n" + + "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); + _this.doTest(null, " /**\n" + + " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + + " * Fall back to xhr sender if beacon is not supported.\n" + + " * @param {boolean} [async=true]\n" + + " * @memberof Initialization\n" + + " */\n" + + "Initialization.prototype.onunloadFlush = function (async) {\n" + + " if (async === void 0) { async = true; }\n" + + " // @DynamicProtoStub\n" + + "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); + _this.doTest(null, "/**\n" + + " * This method tells if given durations should be excluded from collection.\n" + + " */\n" + + "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + + " var durations = [];\n" + + " for (var _i = 0; _i < arguments.length; _i++) {\n" + + " durations[_i] = arguments[_i];\n" + + " }\n" + + " /* @DynamicProtoStub\n" + + " */\n" + + " return true;\n" + + "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); + _this.doTest(null, " /**\n" + + " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + + " * Fall back to xhr sender if beacon is not supported.\n" + + " * @param {boolean} [async=true]\n" + + " * @memberof Initialization\n" + + " */\n" + + "Initialization.prototype.onunloadFlush = function (async) {\n" + + " if (async === void 0) { async = true; }\n" + + " /* @DynamicProtoStub\n" + + " */\n" + + "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); + } + }); + }; + return DynamicProtoRollupTests; + }(TestClass)); + exports.DynamicProtoRollupTests = DynamicProtoRollupTests; +}); +define("test/Selenium/DynamicProtoRollupTests", ["require", "exports", "test/DynamicProtoRollup.Tests"], function (require, exports, DynamicProtoRollup_Tests_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.runTests = void 0; + function runTests() { + new DynamicProtoRollup_Tests_1.DynamicProtoRollupTests().registerTests(); + } + exports.runTests = runTests; +}); +//# sourceMappingURL=dynamicprotorolluptests.js.map \ No newline at end of file diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js.map b/rollup/test/Selenium/dynamicprotorolluptests.js.map new file mode 100644 index 0000000..6d144f9 --- /dev/null +++ b/rollup/test/Selenium/dynamicprotorolluptests.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicprotorolluptests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/removeDynamic.ts","../DynamicProtoRollup.Tests.ts","Dynam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,EACZ,WAAW;wBACX,mGAAmG;wBACnG,0DAA0D;wBAC1D,oCAAoC;wBACpC,+BAA+B;wBAC/B,OAAO;wBACP,+DAA+D;wBAC/D,8CAA8C;wBAC9C,4BAA4B;wBAC5B,MAAM,EACN,+DAA+D,CAAC,CAAC;oBAErE,KAAI,CAAC,MAAM,CAAC,IAAI,EACZ,OAAO;wBACP,+EAA+E;wBAC/E,OAAO;wBACP,8EAA8E;wBAC9E,2BAA2B;wBAC3B,uDAAuD;wBACvD,0CAA0C;wBAC1C,SAAS;wBACT,4BAA4B;wBAC5B,UAAU;wBACV,oBAAoB;wBACpB,MAAM,EACN,mFAAmF,CAAC,CAAC;oBAEzF,KAAI,CAAC,MAAM,CAAC,IAAI,EACZ,WAAW;wBACX,mGAAmG;wBACnG,0DAA0D;wBAC1D,oCAAoC;wBACpC,+BAA+B;wBAC/B,OAAO;wBACP,+DAA+D;wBAC/D,8CAA8C;wBAC9C,4BAA4B;wBAC5B,UAAU;wBACV,MAAM,EACN,+DAA+D,CAAC,CAAC;gBACrE,CAAC;aACR,CAAC,CAAC;QACP,CAAC;QACL,8BAAC;IAAD,CAAC,AAppBD,CAA6C,SAAS,GAopBrD;IAppBY,0DAAuB;;;;;;ICFpC,SAAgB,QAAQ;QACpB,IAAI,kDAAuB,EAAE,CAAC,aAAa,EAAE,CAAC;IAClD,CAAC;IAFD,4BAEC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","import MagicString from 'magic-string';\n\nexport interface IDynamicProtoRollupOptions {\n tagname?: string,\n comment?:string,\n sourcemap?: boolean\n};\n\nfunction escape(str:string) {\n return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\n\nfunction isSourceMapEnabled(options:any) {\n if (options) {\n return options.sourceMap !== false && options.sourcemap !== false;\n }\n\n return false;\n}\n\n// Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always\n// exists in the build / test infrastructure\nfunction padEnd(input:string, len:number, fill:string) {\n let value = input||\"\";\n while (value.length < len) {\n value += fill;\n }\n\n if (value.length > len) {\n value = value.substring(0, len);\n }\n\n return value;\n}\n\nfunction isNullOrWhitespace(value:string) {\n if (value) {\n return value.replace(/\\s/g, \"\").length < 1;\n }\n\n return true;\n}\n\n/**\n * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to\n * remove the boilerplate code require by typescript to define methods as prototype level while\n * using @ms-dynamicProto project to support minification. This can also be used to remove \"debug\"\n * functions from the production code.\n */\nexport default function dynamicRemove(options:IDynamicProtoRollupOptions = {}) {\n var token = (options || {}).tagname || \"@DynamicProtoStub\";\n var replaceValue = (options || {}).comment || \"// Removed Stub for %function%.\";\n let tokenGroups:Array = [4, 10, 13];\n let funcNameGroup:number = 6;\n\n // Because of the test infrastructure (PhamtonJS) the RegEx can't use the \"s\" flag (gis vs gi) or named groups\n const pattern = new RegExp(\"([\\\\t ]*\\\\/\\\\*\\\\*((?!\\\\*\\\\/)(.|\\\\r|\\\\n))*\\\\*\\\\/[\\\\s]*)*(\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[\\\\t ]*([\\\\w]*\\\\.prototype(\\\\.|\\\\[\\\\\\\"|\\\\[\\\\')[\\\\w]*(\\\\\\\"\\\\]|\\\\'\\\\])?)[\\\\t ]*=[\\\\t ]*function[\\\\t ]*\\\\([^\\\\{]*\\\\{[^\\\\/\\\\}\\\\{]*(\\\\{[^\\\\}]*\\\\}[^\\\\/\\\\}\\\\{]*)*(\\\\/[\\\\*\\\\/][\\\\t ]*\" + escape(token) + \"[^\\\\*\\\\r\\\\n]*(\\\\*\\\\/)?(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[^\\\\}]*\\\\};([\\\\t ]*\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*)*\", 'gi');\n\n function formatError(token:string, code:string, pos:number, id:string) {\n let lines = code.split(/(?:\\r\\n|\\n\\r|\\r|\\n)/);\n let lineNumber = 0;\n let count = pos;\n while (count > 0) {\n lineNumber ++;\n count = code.lastIndexOf(\"\\n\", count - 1);\n }\n \n let column = 0;\n let lineStart = code.lastIndexOf(\"\\n\", pos);\n if (lineStart != -1) {\n column = (pos - lineStart);\n } else {\n column = pos + 1;\n }\n \n var message = \"Invalid (Unremoved) token [\" + token + \"] found on line [\" + lineNumber + \"], column [\" + column + \"], position [\" + pos + \"] - \" + (id||\"\") + \"\\n\";\n \n let marker = padEnd(\"\", token.length, \"^\");\n let line = lineNumber - 6;\n if (line > 0) {\n message += \" ...\\n\";\n }\n \n count = 0;\n while (count < 10 && line < lines.length-1) {\n count++;\n if (line >= 0) {\n let number = padEnd(\"\" + (line + 1), 4, \" \");\n message += number + \":\" + lines[line] + \"\\n\";\n if (line == lineNumber-1) {\n message += padEnd(\"\", column + 4, \" \") + marker + \"\\n\";\n }\n }\n \n line++;\n }\n \n if (line < lines.length-1) {\n message += \" ...\\n\";\n }\n \n let match;\n let matchCount = 0;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n if (matchCount == 0) {\n message += \"\\nMatch checks\\n\";\n }\n\n matchCount++;\n if (match[0].length > 0) {\n message += \"Match \" + matchCount + \" tag Groups for \" + (funcName||\"\") + \"\\n\";\n message += \"--=( Complete Matched Content )=--\\n\";\n message += match[0];\n message += \"\\n--------------------------------\\n\";\n for(let lp = 1; lp < match.length; lp++) {\n if (match[lp]) {\n message += \"\" + lp + \": \" + (match[lp] || \"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n if ((match[lp]||\"\").indexOf(token) != -1) {\n message += \" <- Contains tag\";\n }\n message += \"\\n\";\n }\n }\n message += \"\\n\";\n }\n }\n }\n \n return message;\n }\n\n function replaceToken(code:string, theString:MagicString) {\n let result = false;\n let match;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n // Only remove matches that contain a tag and function\n let hasToken = false;\n for(let lp = 0; lp < tokenGroups.length; lp++) {\n if ((match[tokenGroups[lp]]||\"\").indexOf(token) != -1) {\n hasToken = true;\n break;\n }\n }\n \n if (hasToken) {\n result = true;\n let start = match.index;\n let newValue = replaceValue.replace(\"%function%\", funcName);\n theString.overwrite(start, start + match[0].length, newValue);\n }\n }\n }\n\n return result;\n }\n\n function checkResult(result:string, id:string) {\n if (result) {\n let pos = result.indexOf(token);\n if (pos != -1) {\n throw new Error(formatError(token, result, pos, id));\n }\n }\n }\n\n function doTransform(code:string, id:string) {\n let theString = new MagicString(code);\n if (!replaceToken(code, theString)) {\n return null;\n }\n\n let result:any = { code: theString.toString() };\n if (isSourceMapEnabled(options)) {\n result.map = theString.generateMap({hires: true});\n }\n\n return result;\n }\n\n function doTransformAndCheck(code:string, id:string) {\n let result = doTransform(code, id);\n if (result) {\n // Do a final check of the string\n checkResult(result.code, id);\n } else {\n // Check that the raw input doesn't include the tag\n checkResult(code, id);\n }\n\n return result;\n }\n\n return {\n name: 'dynamicRemove',\n renderChunk(code:string, chunk:any) {\n return doTransformAndCheck(code, chunk.filename);\n },\n transform: doTransformAndCheck\n }\n}\n \n ","/// \n\nimport dynamicRemove from '../src/removeDynamic';\n\nexport class DynamicProtoRollupTests extends TestClass {\n\n public testInitialize() {\n }\n\n private visibleNewlines(value) {\n if (value) {\n return value.replace(/\\r/g, \"\\\\r\").replace(/\\n/g, \"\\\\n\");\n }\n\n return value;\n }\n\n private convertNewlines(value, newline) {\n if (value) {\n return value.replace(/\\n/g, newline);\n }\n\n return value;\n }\n\n private testNoChange(options:any, input:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n QUnit.assert.equal(plugin.renderChunk(input, { filename: \"test.js\" }), null);\n QUnit.assert.equal(plugin.transform(input, \"testId\"), null);\n }\n\n private doTest(options:any, input:string, expected:string) {\n this.testExpected(options, input, expected);\n this.testExpected(options, this.convertNewlines(input, \"\\r\"), this.convertNewlines(expected, \"\\r\"));\n this.testExpected(options, this.convertNewlines(input, \"\\r\\n\"), this.convertNewlines(expected, \"\\r\\n\"));\n this.testExpected(options, this.convertNewlines(input, \"\\n\\r\"), this.convertNewlines(expected, \"\\n\\r\"));\n }\n\n private testExpected(options:any, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n let result = plugin.renderChunk(input, { filename: \"test.js\" });\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n\n result = plugin.transform(input, \"testId\");\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n }\n\n private testError(options:any, message:string, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.throws(() => {\n plugin.renderChunk(input, { filename: \"test.js\" });\n }, new Error(expected), message);\n\n QUnit.assert.throws(() => {\n plugin.transform(input, \"test.js\");\n }, new Error(expected), message);\n }\n\n public registerTests() {\n this.testCase({\n name: \"No matching values for removal\",\n test: () => {\n this.testNoChange(null, \"Nothing removed\");\n\n this.testNoChange(null, \"ClassName.prototype.anotherMethod = function () {\\n};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"// @Stub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" // @Stub -- Type 2 single line comment\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment */\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\");\n }\n });\n\n this.testCase({\n name: \"Basic tag patterns\",\n test: () => {\n this.doTest(null, \n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n this.testCase({\n name: \"Mixed tagtype combinations\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.testExpected(null, \n // Input, \n \" /**\\r\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\\n\" + \n \" * @param coreConfig - The core configuration.\\r\\n\" + \n \" * @param core - The AppInsights core.\\r\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\r\\n\" + \n \" */\\r\\n\" + \n \" // @DynamicProtoStub \\r\\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\r\\n\" + \n \" };\\r\\n\" + \n \" /**\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\" + \n \" * @param coreConfig - The core configuration.\\r\" + \n \" * @param core - The AppInsights core.\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\r\" + \n \" */\\r\" + \n \" // @DynamicProtoStub \\r\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\r\" + \n \" };\\r\" + \n \" /**\\n\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\\r\" + \n \" * @param coreConfig - The core configuration.\\n\\r\" + \n \" * @param core - The AppInsights core.\\n\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\n\\r\" + \n \" */\\n\\r\" + \n \" // @DynamicProtoStub \\n\\r\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\\r\" + \n \" };\\n\\r\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\r\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\r\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\\r\"\n );\n }\n });\n\n this.testCase({\n name: \"Stubs with return values\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test reserved (ES3) function names\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"catch2\\\"] = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch2\\\"].\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" +\n \" return TestClass;\",\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"delete\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"throw\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype[\\\"delete\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"throw\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype['if'].\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test unconverted tags from partial conversion\",\n test: () => {\n this.testError(null, \n \"1 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\");\n \n this.testError(null, \n \"2 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"3 -- Type 2 multiline comment\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"4 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\");\n\n this.testError(null,\n \"5 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\" +\n \"5 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n\n \n this.testError(null,\n \"6 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"7 -- Type 2 multiline comment */\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"8 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\" +\n \"6 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n\n this.testCase({\n name: \"Test prefixed comment with typescript boilerplate for spread and default arguments\",\n test: () => {\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" // @DynamicProtoStub\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" // @DynamicProtoStub\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n }\n });\n }\n}\n","import { DynamicProtoRollupTests } from '../DynamicProtoRollup.Tests';\n\nexport function runTests() {\n new DynamicProtoRollupTests().registerTests();\n}\n"]} \ No newline at end of file From 1f6763a7fe68b712997dc2f5143b7a1cc32dfa17 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 20:36:58 +0000 Subject: [PATCH 18/22] Remove _isRestrictedEnvironment function as requested Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- lib/src/DynamicProto.ts | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/lib/src/DynamicProto.ts b/lib/src/DynamicProto.ts index 1438259..e499dd6 100644 --- a/lib/src/DynamicProto.ts +++ b/lib/src/DynamicProto.ts @@ -18,36 +18,7 @@ interface DynamicGlobalSettings { -/** - * Helper to check if we're running in a restricted environment that doesn't support - * property redefinition, like Cloudflare Workers. This is primarily used to avoid - * operations that would cause issues in these environments. - * @ignore - */ -function _isRestrictedEnvironment(): boolean { - try { - // Test if we can perform basic property operations that would be restricted - // in environments like Cloudflare Workers using operations similar to what the library does - let testObj = {}; - let testFunc = function() { return "test"; }; - let testProp = "_dynTestProp"; - - // Try to set a property (similar to how we set dynamic properties) - testObj[testProp] = 1; - - // Try to set a property on a function (similar to tagging functions) - testFunc[testProp] = 1; - - // Try to delete the property (similar to removing instance methods) - delete testObj[testProp]; - - // If all operations succeed, not a restricted environment - return false; - } catch (e) { - // If any operation fails, we're in a restricted environment - return true; - } -} + /** * Constant string defined to support minimization @@ -664,7 +635,7 @@ export default function dynamicProto(theClass:DPCls, target:DPTyp delegateFunc(target, baseFuncs as DPType); // Don't allow setting instance functions in older browsers or restricted environments - let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs] && !_isRestrictedEnvironment(); + let setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } From 095f37d339626c0f0343a96f8756134186e37b18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 20:49:15 +0000 Subject: [PATCH 19/22] Restore original devDependencies order in package.json Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bbeaa5b..26ae575 100644 --- a/package.json +++ b/package.json @@ -47,13 +47,10 @@ }, "devDependencies": { "@microsoft/rush": "5.148.0", - "@nevware21/grunt-eslint-ts": "^0.1.0", "@nevware21/grunt-ts-plugin": "^0.3.0", - "@rollup/plugin-node-resolve": "^9.0.0", - "@rollup/plugin-replace": "^2.3.3", + "@nevware21/grunt-eslint-ts": "^0.1.0", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", - "copyfiles": "^2.4.1", "eslint": "^7.29.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.23.4", @@ -66,9 +63,12 @@ "grunt-contrib-qunit": "^4.0.0", "grunt-contrib-uglify": "^5.0.1", "grunt-run": "^0.8.1", - "rollup": "^2.32.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^2.3.3", "rollup-plugin-cleanup": "3.2.1", + "rollup": "^2.32.0", "typedoc": "^0.23.25", - "typescript": "^4.9.5" + "typescript": "^4.9.5", + "copyfiles": "^2.4.1" } } From d3d60f43012f8e2de6072abe6624279647999577 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 22:36:36 +0000 Subject: [PATCH 20/22] Remove test files excluded by .gitignore from PR Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- .../Selenium/dynamicprotorolluptests.d.ts | 214 ---- .../test/Selenium/dynamicprotorolluptests.js | 1107 ----------------- .../Selenium/dynamicprotorolluptests.js.map | 1 - 3 files changed, 1322 deletions(-) delete mode 100644 rollup/test/Selenium/dynamicprotorolluptests.d.ts delete mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js delete mode 100644 rollup/test/Selenium/dynamicprotorolluptests.js.map diff --git a/rollup/test/Selenium/dynamicprotorolluptests.d.ts b/rollup/test/Selenium/dynamicprotorolluptests.d.ts deleted file mode 100644 index 76808f3..0000000 --- a/rollup/test/Selenium/dynamicprotorolluptests.d.ts +++ /dev/null @@ -1,214 +0,0 @@ -/// -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -declare class Assert { - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static deepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static equal(expected: any, actual: any, message?: string): any; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - static notDeepEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notEqual(expected: any, actual: any, message?: string): any; - static notPropEqual(expected: any, actual: any, message?: string): any; - static propEqual(expected: any, actual: any, message?: string): any; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static notStrictEqual(expected: any, actual: any, message?: string): any; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - static ok(state: any, message?: string): any; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - static strictEqual(expected: any, actual: any, message?: string): any; - /** - * Assertion to test if a callback throws an exception when run. - * - * When testing code that is expected to throw an exception based on a specific set of - * circumstances, use throws() to catch the error object for testing and comparison. - * - * @param block Function to execute - * @param expected Error Object to compare - * @param message A short description of the assertion - */ - static throws(block: () => any, expected: any, message?: string): any; - /** - * @param block Function to execute - * @param message A short description of the assertion - */ - static throws(block: () => any, message?: string): any; -} -/** Defines a test case */ -declare class TestCase { - /** Name to use for the test case */ - name: string; - /** Test case method */ - test: () => void; -} -/** Defines a test case */ -interface TestCaseAsync { - /** Name to use for the test case */ - name: string; - /** time to wait after pre before invoking post and calling start() */ - stepDelay: number; - /** async steps */ - steps: Array<() => void>; -} -declare class TestClass { - constructor(name?: string); - static isPollingStepFlag: string; - /** The instance of the currently running suite. */ - static currentTestClass: TestClass; - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - useFakeTimers: boolean; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - useFakeServer: boolean; - /** Method called before the start of each test method */ - testInitialize(): void; - /** Method called after each test method has completed */ - testCleanup(): void; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - registerTests(): void; - /** Register an async Javascript unit testcase. */ - testCaseAsync(testInfo: TestCaseAsync): void; - /** Register a Javascript unit testcase. */ - testCase(testInfo: TestCase): void; - /** Called when the test is starting. */ - private _testStarting; - /** Called when the test is completed. */ - private _testCompleted; - /**** Sinon methods and properties ***/ - clock: SinonFakeTimers; - server: SinonFakeServer; - sandbox: SinonSandbox; - /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */ - spy(): SinonSpy; - /** Spies on the provided function */ - spy(funcToWrap: Function): SinonSpy; - /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */ - spy(object: any, methodName: string, func?: Function): SinonSpy; - /** Creates an anonymous stub function. */ - stub(): SinonStub; - /** Stubs all the object's methods. */ - stub(object: any): SinonStub; - /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */ - stub(object: any, methodName: string, func?: Function): SinonStub; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - mock(object: any): SinonMock; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number): void; - protected setUserAgent(userAgent: string): void; -} -declare module "src/removeDynamic" { - export interface IDynamicProtoRollupOptions { - tagname?: string; - comment?: string; - sourcemap?: boolean; - } - /** - * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to - * remove the boilerplate code require by typescript to define methods as prototype level while - * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" - * functions from the production code. - */ - export default function dynamicRemove(options?: IDynamicProtoRollupOptions): { - name: string; - renderChunk(code: string, chunk: any): any; - transform: (code: string, id: string) => any; - }; -} -declare module "test/DynamicProtoRollup.Tests" { - export class DynamicProtoRollupTests extends TestClass { - testInitialize(): void; - private visibleNewlines; - private convertNewlines; - private testNoChange; - private doTest; - private testExpected; - private testError; - registerTests(): void; - } -} -declare module "test/Selenium/DynamicProtoRollupTests" { - export function runTests(): void; -} diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js b/rollup/test/Selenium/dynamicprotorolluptests.js deleted file mode 100644 index c9dab61..0000000 --- a/rollup/test/Selenium/dynamicprotorolluptests.js +++ /dev/null @@ -1,1107 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/// -/** - * Wrapper around QUnit asserts. This class has two purposes: - * - Make Assertion methods easy to discover. - * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values. - */ -var Assert = /** @class */ (function () { - function Assert() { - } - /** - * A deep recursive comparison assertion, working on primitive types, arrays, objects, - * regular expressions, dates and functions. - * - * The deepEqual() assertion can be used just like equal() when comparing the value of - * objects, such that { key: value } is equal to { key: value }. For non-scalar values, - * identity will be disregarded by deepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.deepEqual = function (expected, actual, message) { - return deepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals. - * - * The equal assertion uses the simple comparison operator (==) to compare the actual - * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. - * When it fails, both actual and expected values are displayed in the test result, - * in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.equal = function (expected, actual, message) { - return equal(actual, expected, message); - }; - /** - * An inverted deep recursive comparison assertion, working on primitive types, - * arrays, objects, regular expressions, dates and functions. - * - * The notDeepEqual() assertion can be used just like equal() when comparing the - * value of objects, such that { key: value } is equal to { key: value }. For non-scalar - * values, identity will be disregarded by notDeepEqual. - * - * @param expected Known comparison value - * @param actual Object or Expression being tested - * @param message A short description of the assertion - */ - Assert.notDeepEqual = function (expected, actual, message) { - return notDeepEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notEqual assertion uses the simple inverted comparison operator (!=) to compare - * the actual and expected arguments. When they aren't equal, the assertion passes: any; - * otherwise, it fails. When it fails, both actual and expected values are displayed - * in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notEqual = function (expected, actual, message) { - return notEqual(actual, expected, message); - }; - Assert.notPropEqual = function (expected, actual, message) { - return notPropEqual(actual, expected, message); - }; - Assert.propEqual = function (expected, actual, message) { - return propEqual(actual, expected, message); - }; - /** - * A non-strict comparison assertion, checking for inequality. - * - * The notStrictEqual assertion uses the strict inverted comparison operator (!==) - * to compare the actual and expected arguments. When they aren't equal, the assertion - * passes: any; otherwise, it fails. When it fails, both actual and expected values are - * displayed in the test result, in addition to a given message. - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.notStrictEqual = function (expected, actual, message) { - return notStrictEqual(actual, expected, message); - }; - /** - * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). - * Passes if the first argument is truthy. - * - * The most basic assertion in QUnit, ok() requires just one argument. If the argument - * evaluates to true, the assertion passes; otherwise, it fails. If a second message - * argument is provided, it will be displayed in place of the result. - * - * @param state Expression being tested - * @param message A short description of the assertion - */ - Assert.ok = function (state, message) { - return ok(state, message); - }; - /** - * A strict type and value comparison assertion. - * - * The strictEqual() assertion provides the most rigid comparison of type and value with - * the strict equality operator (===) - * - * @param expected Known comparison value - * @param actual Expression being tested - * @param message A short description of the assertion - */ - Assert.strictEqual = function (expected, actual, message) { - return strictEqual(actual, expected, message); - }; - Assert.throws = function (block, expected, message) { - return throws(block, expected, message); - }; - return Assert; -}()); -/** Defines a test case */ -var TestCase = /** @class */ (function () { - function TestCase() { - } - return TestCase; -}()); -/// -/// -/// -/// -var TestClass = /** @class */ (function () { - function TestClass(name) { - /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */ - this.useFakeTimers = true; - /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */ - this.useFakeServer = true; - QUnit.module(name); - } - /** Method called before the start of each test method */ - TestClass.prototype.testInitialize = function () { - }; - /** Method called after each test method has completed */ - TestClass.prototype.testCleanup = function () { - }; - /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */ - TestClass.prototype.registerTests = function () { - }; - /** Register an async Javascript unit testcase. */ - TestClass.prototype.testCaseAsync = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (isNaN(testInfo.stepDelay)) { - throw new Error("Must specify 'stepDelay' period between pre and post"); - } - if (!testInfo.steps) { - throw new Error("Must specify 'steps' to take asynchronously"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function (assert) { - var done = assert.async(); - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - var steps_1 = testInfo.steps; - var trigger_1 = function () { - if (steps_1.length) { - var step = steps_1.shift(); - // The callback which activates the next test step. - var nextTestStepTrigger = function () { - setTimeout(function () { - trigger_1(); - }, testInfo.stepDelay); - }; - // There 2 types of test steps - simple and polling. - // Upon completion of the simple test step the next test step will be called. - // In case of polling test step the next test step is passed to the polling test step, and - // it is responsibility of the polling test step to call the next test step. - try { - if (step[TestClass.isPollingStepFlag]) { - step.call(_this, nextTestStepTrigger); - } - else { - step.call(_this); - nextTestStepTrigger.call(_this); - } - } - catch (e) { - _this._testCompleted(); - Assert.ok(false, e.toString()); - // done is QUnit callback indicating the end of the test - done(); - return; - } - } - else { - _this._testCompleted(); - // done is QUnit callback indicating the end of the test - done(); - } - }; - trigger_1(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - // done is QUnit callback indicating the end of the test - done(); - } - }; - // Register the test with QUnit - QUnit.test(testInfo.name, testMethod); - }; - /** Register a Javascript unit testcase. */ - TestClass.prototype.testCase = function (testInfo) { - var _this = this; - if (!testInfo.name) { - throw new Error("Must specify name in testInfo context in registerTestcase call"); - } - if (!testInfo.test) { - throw new Error("Must specify 'test' method in testInfo context in registerTestcase call"); - } - // Create a wrapper around the test method so we can do test initilization and cleanup. - var testMethod = function () { - // Save off the instance of the currently running suite. - TestClass.currentTestClass = _this; - // Run the test. - try { - _this._testStarting(); - testInfo.test.call(_this); - _this._testCompleted(); - } - catch (ex) { - Assert.ok(false, "Unexpected Exception: " + ex); - _this._testCompleted(true); - } - }; - // Register the test with QUnit - test(testInfo.name, testMethod); - }; - /** Called when the test is starting. */ - TestClass.prototype._testStarting = function () { - // Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class. - var config = sinon.getConfig(sinon.config); - config.useFakeTimers = this.useFakeTimers; - config.useFakeServer = this.useFakeServer; - config.injectInto = config.injectIntoThis && this || config.injectInto; - this.sandbox = sinon.sandbox.create(config); - this.server = this.sandbox.server; - // Allow the derived class to perform test initialization. - this.testInitialize(); - }; - /** Called when the test is completed. */ - TestClass.prototype._testCompleted = function (failed) { - if (failed) { - // Just cleanup the sandbox since the test has already failed. - this.sandbox.restore(); - } - else { - // Verify the sandbox and restore. - this.sandbox.verifyAndRestore(); - } - this.testCleanup(); - // Clear the instance of the currently running suite. - TestClass.currentTestClass = null; - }; - TestClass.prototype.spy = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - TestClass.prototype.stub = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return null; - }; - /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */ - TestClass.prototype.mock = function (object) { return null; }; - /**** end: Sinon methods and properties ***/ - /** Sends a JSON response to the provided request. - * @param request The request to respond to. - * @param data Data to respond with. - * @param errorCode Optional error code to send with the request, default is 200 - */ - TestClass.prototype.sendJsonResponse = function (request, data, errorCode) { - if (errorCode === undefined) { - errorCode = 200; - } - request.respond(errorCode, { "Content-Type": "application/json" }, JSON.stringify(data)); - }; - TestClass.prototype.setUserAgent = function (userAgent) { - Object.defineProperty(window.navigator, 'userAgent', { - configurable: true, - get: function () { - return userAgent; - } - }); - }; - TestClass.isPollingStepFlag = "isPollingStep"; - return TestClass; -}()); -// Configure Sinon -sinon.assert.fail = function (msg) { - Assert.ok(false, msg); -}; -sinon.assert.pass = function (assertion) { - Assert.ok(assertion, "sinon assert"); -}; -sinon.config = { - injectIntoThis: true, - injectInto: null, - properties: ["spy", "stub", "mock", "clock", "sandbox"], - useFakeTimers: true, - useFakeServer: true -}; -/// -/// -/// -/// -/// -define("src/removeDynamic", ["require", "exports", "magic-string"], function (require, exports, magic_string_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - ; - function escape(str) { - return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); - } - function isSourceMapEnabled(options) { - if (options) { - return options.sourceMap !== false && options.sourcemap !== false; - } - return false; - } - // Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always - // exists in the build / test infrastructure - function padEnd(input, len, fill) { - var value = input || ""; - while (value.length < len) { - value += fill; - } - if (value.length > len) { - value = value.substring(0, len); - } - return value; - } - function isNullOrWhitespace(value) { - if (value) { - return value.replace(/\s/g, "").length < 1; - } - return true; - } - /** - * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to - * remove the boilerplate code require by typescript to define methods as prototype level while - * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" - * functions from the production code. - */ - function dynamicRemove(options) { - if (options === void 0) { options = {}; } - var token = (options || {}).tagname || "@DynamicProtoStub"; - var replaceValue = (options || {}).comment || "// Removed Stub for %function%."; - var tokenGroups = [4, 10, 13]; - var funcNameGroup = 6; - // Because of the test infrastructure (PhamtonJS) the RegEx can't use the "s" flag (gis vs gi) or named groups - var pattern = new RegExp("([\\t ]*\\/\\*\\*((?!\\*\\/)(.|\\r|\\n))*\\*\\/[\\s]*)*(\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*(\\r\\n|\\n\\r|\\r|\\n))*[\\t ]*([\\w]*\\.prototype(\\.|\\[\\\"|\\[\\')[\\w]*(\\\"\\]|\\'\\])?)[\\t ]*=[\\t ]*function[\\t ]*\\([^\\{]*\\{[^\\/\\}\\{]*(\\{[^\\}]*\\}[^\\/\\}\\{]*)*(\\/[\\*\\/][\\t ]*" + escape(token) + "[^\\*\\r\\n]*(\\*\\/)?(\\r\\n|\\n\\r|\\r|\\n))*[^\\}]*\\};([\\t ]*\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*)*", 'gi'); - function formatError(token, code, pos, id) { - var lines = code.split(/(?:\r\n|\n\r|\r|\n)/); - var lineNumber = 0; - var count = pos; - while (count > 0) { - lineNumber++; - count = code.lastIndexOf("\n", count - 1); - } - var column = 0; - var lineStart = code.lastIndexOf("\n", pos); - if (lineStart != -1) { - column = (pos - lineStart); - } - else { - column = pos + 1; - } - var message = "Invalid (Unremoved) token [" + token + "] found on line [" + lineNumber + "], column [" + column + "], position [" + pos + "] - " + (id || "") + "\n"; - var marker = padEnd("", token.length, "^"); - var line = lineNumber - 6; - if (line > 0) { - message += " ...\n"; - } - count = 0; - while (count < 10 && line < lines.length - 1) { - count++; - if (line >= 0) { - var number = padEnd("" + (line + 1), 4, " "); - message += number + ":" + lines[line] + "\n"; - if (line == lineNumber - 1) { - message += padEnd("", column + 4, " ") + marker + "\n"; - } - } - line++; - } - if (line < lines.length - 1) { - message += " ...\n"; - } - var match; - var matchCount = 0; - while ((match = pattern.exec(code))) { - var funcName = match[funcNameGroup]; - if (!isNullOrWhitespace(funcName)) { - if (matchCount == 0) { - message += "\nMatch checks\n"; - } - matchCount++; - if (match[0].length > 0) { - message += "Match " + matchCount + " tag Groups for " + (funcName || "") + "\n"; - message += "--=( Complete Matched Content )=--\n"; - message += match[0]; - message += "\n--------------------------------\n"; - for (var lp = 1; lp < match.length; lp++) { - if (match[lp]) { - message += "" + lp + ": " + (match[lp] || "").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); - if ((match[lp] || "").indexOf(token) != -1) { - message += " <- Contains tag"; - } - message += "\n"; - } - } - message += "\n"; - } - } - } - return message; - } - function replaceToken(code, theString) { - var result = false; - var match; - while ((match = pattern.exec(code))) { - var funcName = match[funcNameGroup]; - if (!isNullOrWhitespace(funcName)) { - // Only remove matches that contain a tag and function - var hasToken = false; - for (var lp = 0; lp < tokenGroups.length; lp++) { - if ((match[tokenGroups[lp]] || "").indexOf(token) != -1) { - hasToken = true; - break; - } - } - if (hasToken) { - result = true; - var start_1 = match.index; - var newValue = replaceValue.replace("%function%", funcName); - theString.overwrite(start_1, start_1 + match[0].length, newValue); - } - } - } - return result; - } - function checkResult(result, id) { - if (result) { - var pos = result.indexOf(token); - if (pos != -1) { - throw new Error(formatError(token, result, pos, id)); - } - } - } - function doTransform(code, id) { - var theString = new magic_string_1.default(code); - if (!replaceToken(code, theString)) { - return null; - } - var result = { code: theString.toString() }; - if (isSourceMapEnabled(options)) { - result.map = theString.generateMap({ hires: true }); - } - return result; - } - function doTransformAndCheck(code, id) { - var result = doTransform(code, id); - if (result) { - // Do a final check of the string - checkResult(result.code, id); - } - else { - // Check that the raw input doesn't include the tag - checkResult(code, id); - } - return result; - } - return { - name: 'dynamicRemove', - renderChunk: function (code, chunk) { - return doTransformAndCheck(code, chunk.filename); - }, - transform: doTransformAndCheck - }; - } - exports.default = dynamicRemove; -}); -/// -define("test/DynamicProtoRollup.Tests", ["require", "exports", "src/removeDynamic"], function (require, exports, removeDynamic_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DynamicProtoRollupTests = void 0; - var DynamicProtoRollupTests = /** @class */ (function (_super) { - __extends(DynamicProtoRollupTests, _super); - function DynamicProtoRollupTests() { - return _super !== null && _super.apply(this, arguments) || this; - } - DynamicProtoRollupTests.prototype.testInitialize = function () { - }; - DynamicProtoRollupTests.prototype.visibleNewlines = function (value) { - if (value) { - return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n"); - } - return value; - }; - DynamicProtoRollupTests.prototype.convertNewlines = function (value, newline) { - if (value) { - return value.replace(/\n/g, newline); - } - return value; - }; - DynamicProtoRollupTests.prototype.testNoChange = function (options, input) { - var plugin = (0, removeDynamic_1.default)(options); - QUnit.assert.equal(plugin.name, "dynamicRemove"); - QUnit.assert.equal(plugin.renderChunk(input, { filename: "test.js" }), null); - QUnit.assert.equal(plugin.transform(input, "testId"), null); - }; - DynamicProtoRollupTests.prototype.doTest = function (options, input, expected) { - this.testExpected(options, input, expected); - this.testExpected(options, this.convertNewlines(input, "\r"), this.convertNewlines(expected, "\r")); - this.testExpected(options, this.convertNewlines(input, "\r\n"), this.convertNewlines(expected, "\r\n")); - this.testExpected(options, this.convertNewlines(input, "\n\r"), this.convertNewlines(expected, "\n\r")); - }; - DynamicProtoRollupTests.prototype.testExpected = function (options, input, expected) { - var plugin = (0, removeDynamic_1.default)(options); - QUnit.assert.equal(plugin.name, "dynamicRemove"); - var result = plugin.renderChunk(input, { filename: "test.js" }); - QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); - result = plugin.transform(input, "testId"); - QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null)); - }; - DynamicProtoRollupTests.prototype.testError = function (options, message, input, expected) { - var plugin = (0, removeDynamic_1.default)(options); - QUnit.assert.throws(function () { - plugin.renderChunk(input, { filename: "test.js" }); - }, new Error(expected), message); - QUnit.assert.throws(function () { - plugin.transform(input, "test.js"); - }, new Error(expected), message); - }; - DynamicProtoRollupTests.prototype.registerTests = function () { - var _this = this; - this.testCase({ - name: "No matching values for removal", - test: function () { - _this.testNoChange(null, "Nothing removed"); - _this.testNoChange(null, "ClassName.prototype.anotherMethod = function () {\n};\n"); - _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n"); - _this.testNoChange(null, "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n"); - _this.testNoChange(null, "// @Stub -- Type 1 comment\n" + - "function methodName() {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n"); - _this.testNoChange(null, "function methodName() {\n" + - " // @Stub -- Type 2 single line comment\n" + - "};\n"); - _this.testNoChange(null, "function methodName() {\n" + - " /* @Stub -- Type 2 multiline comment */\n" + - "};\n"); - _this.testNoChange(null, "function methodName() {\n" + - " /* @Stub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n"); - } - }); - this.testCase({ - name: "Basic tag patterns", - test: function () { - _this.doTest(null, "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + - " // @DynamicProtoStub -- Type 2 single line comment\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - _this.doTest(null, "ClassName.prototype.methodName = function () {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n", "// Removed Stub for ClassName.prototype.methodName.\n"); - } - }); - this.testCase({ - name: "Mixed tagtype combinations", - test: function () { - _this.doTest(null, - // Input, - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + - " }; // @DynamicProtoStub - Tag type 3\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + - " // @DynamicProtoStub - Tag type 2.1\n" + - " };\n" + - " TestClass.prototype.func5 = function () {\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + - " /* @DynamicProtoStub - Tag type 2.2 */\n" + - " };\n" + - " return TestClass;", - // Expected Value - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - "// Removed Stub for TestClass.prototype.func1.\n" + - "// Removed Stub for TestClass.prototype.func2.\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func4.\n" + - " TestClass.prototype.func5 = function () {\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func6.\n" + - " return TestClass;"); - _this.testExpected(null, - // Input, - " /**\r\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r\n" + - " * @param coreConfig - The core configuration.\r\n" + - " * @param core - The AppInsights core.\r\n" + - " * @param extensions - An array of all the plugins being used.\r\n" + - " */\r\n" + - " // @DynamicProtoStub \r\n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\r\n" + - " };\r\n" + - " /**\r" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\r" + - " * @param coreConfig - The core configuration.\r" + - " * @param core - The AppInsights core.\r" + - " * @param extensions - An array of all the plugins being used.\r" + - " */\r" + - " // @DynamicProtoStub \r" + - " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\r" + - " };\r" + - " /**\n\r" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n\r" + - " * @param coreConfig - The core configuration.\n\r" + - " * @param core - The AppInsights core.\n\r" + - " * @param extensions - An array of all the plugins being used.\n\r" + - " */\n\r" + - " // @DynamicProtoStub \n\r" + - " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n\r" + - " };\n\r" + - "", - // Expected Value - "// Removed Stub for TestClass.prototype.func1.\r\n" + - "// Removed Stub for TestClass.prototype.func2.\r" + - "// Removed Stub for TestClass.prototype.func3.\n\r"); - } - }); - this.testCase({ - name: "Stubs with return values", - test: function () { - _this.doTest(null, - // Input, - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + - " return;\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func2 = function (evt, itemCtx) {\n" + - " return;\n" + - " }; // @DynamicProtoStub - Tag type 3\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func4 = function (evt, itemCtx) {\n" + - " // @DynamicProtoStub - Tag type 2.1\n" + - " return;\n" + - " };\n" + - " TestClass.prototype.func5 = function () {\n" + - " return;\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype.func6 = function (evt, itemCtx) {\n" + - " /* @DynamicProtoStub - Tag type 2.2 */\n" + - " return;\n" + - " };\n" + - " return TestClass;", - // Expected Value - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - "// Removed Stub for TestClass.prototype.func1.\n" + - "// Removed Stub for TestClass.prototype.func2.\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype.func3 = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func4.\n" + - " TestClass.prototype.func5 = function () {\n" + - " return;\n" + - " };\n" + - "// Removed Stub for TestClass.prototype.func6.\n" + - " return TestClass;"); - _this.doTest(null, - // Input, - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - "", - // Expected Value - "// Removed Stub for TestClass.prototype.func1.\n" + - "// Removed Stub for TestClass.prototype.func2.\n" + - "// Removed Stub for TestClass.prototype.func3.\n"); - } - }); - this.testCase({ - name: "Test reserved (ES3) function names", - test: function () { - _this.doTest(null, - // Input, - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " };\n" + - " /**\n" + - " * Process an event to add it to the local storage and then pass it to the next plugin.\n" + - " * @param event - The event that needs to be stored.\n" + - " * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\n" + - " * can optionally use this to access the current core instance or define / pass additional information\n" + - " * to later plugins (vs appending items to the telemetry item)\n" + - " */\n" + - " TestClass.prototype[\"catch2\"] = function (evt, itemCtx) {\n" + - " return;\n" + - " }; // @DynamicProtoStub - Tag type 3\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype[\"func3\"] = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - " return TestClass;", - // Expected Value - " /* ================================================================================================================\n" + - " * DO NOT add any code to these empty implementations as any code defined here will be removed, as\n" + - " /*\n" + - "// Removed Stub for TestClass.prototype[\"catch\"].\n" + - "// Removed Stub for TestClass.prototype[\"catch2\"].\n" + - " /**\n" + - " * Hello World\n" + - " */\n" + - " TestClass.prototype[\"func3\"] = function () {\n" + - " // Normal Function\n" + - " return;\n" + - " };\n" + - " return TestClass;"); - _this.doTest(null, - // Input, - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"catch\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"delete\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype[\"throw\"] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - " /**\n" + - " * The function does the initial set up. It adds a notification listener to determine which events to remove.\n" + - " * @param coreConfig - The core configuration.\n" + - " * @param core - The AppInsights core.\n" + - " * @param extensions - An array of all the plugins being used.\n" + - " */\n" + - " // @DynamicProtoStub \n" + - " TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\n" + - " throw \"Not Implemented\";\n" + - " };\n" + - "", - // Expected Value - "// Removed Stub for TestClass.prototype[\"catch\"].\n" + - "// Removed Stub for TestClass.prototype[\"delete\"].\n" + - "// Removed Stub for TestClass.prototype[\"throw\"].\n" + - "// Removed Stub for TestClass.prototype['if'].\n"); - } - }); - this.testCase({ - name: "Test unconverted tags from partial conversion", - test: function () { - _this.testError(null, "1 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + - "function methodName() {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + - "1 :// @DynamicProtoStub -- Type 1 comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "2 :function methodName() {\n" + - "3 : // This is a comment for a dynamic proto stub\n" + - "4 :};\n"); - _this.testError(null, "2 -- Type 2 single line comment", "function methodName() {\n" + - " // @DynamicProtoStub -- Type 2 single line comment\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n"); - _this.testError(null, "3 -- Type 2 multiline comment", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n"); - _this.testError(null, "4 -- Type 2 multiline comment (2)", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 : * Continuation of a multi-line comment/\n" + - "4 : */\n" + - "5 :};\n"); - _this.testError(null, "5 -- Type 1 comment", "// @DynamicProtoStub -- Type 1 comment\n" + - "function methodName() {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\n" + - "1 :// @DynamicProtoStub -- Type 1 comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "2 :function methodName() {\n" + - "3 : // This is a comment for a dynamic proto stub\n" + - "4 :};\n" + - "5 :// Removed Stub for ClassName.prototype.methodName.\n"); - _this.testError(null, "6 -- Type 2 single line comment", "function methodName() {\n" + - " // @DynamicProtoStub -- Type 2 single line comment\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : // @DynamicProtoStub -- Type 2 single line comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n" + - "4 :// Removed Stub for ClassName.prototype.methodName.\n"); - _this.testError(null, "7 -- Type 2 multiline comment */", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment */\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 :};\n" + - "4 :// Removed Stub for ClassName.prototype.methodName.\n"); - _this.testError(null, "8 -- Type 2 multiline comment (2)", "function methodName() {\n" + - " /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " * Continuation of a multi-line comment/\n" + - " */\n" + - "};\n" + - "// @DynamicProtoStub -- Type 1 comment\n" + - "ClassName.prototype.methodName = function () {\n" + - " // This is a comment for a dynamic proto stub\n" + - "};\n", "Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\n" + - "1 :function methodName() {\n" + - "2 : /* @DynamicProtoStub -- Type 2 multiline comment\n" + - " ^^^^^^^^^^^^^^^^^\n" + - "3 : * Continuation of a multi-line comment/\n" + - "4 : */\n" + - "5 :};\n" + - "6 :// Removed Stub for ClassName.prototype.methodName.\n"); - } - }); - this.testCase({ - name: "Test prefixed comment with typescript boilerplate for spread and default arguments", - test: function () { - _this.doTest(null, "/**\n" + - " * This method tells if given durations should be excluded from collection.\n" + - " */\n" + - "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + - " var durations = [];\n" + - " for (var _i = 0; _i < arguments.length; _i++) {\n" + - " durations[_i] = arguments[_i];\n" + - " }\n" + - " // @DynamicProtoStub\n" + - " return true;\n" + - "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); - _this.doTest(null, " /**\n" + - " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + - " * Fall back to xhr sender if beacon is not supported.\n" + - " * @param {boolean} [async=true]\n" + - " * @memberof Initialization\n" + - " */\n" + - "Initialization.prototype.onunloadFlush = function (async) {\n" + - " if (async === void 0) { async = true; }\n" + - " // @DynamicProtoStub\n" + - "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); - _this.doTest(null, "/**\n" + - " * This method tells if given durations should be excluded from collection.\n" + - " */\n" + - "PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\n" + - " var durations = [];\n" + - " for (var _i = 0; _i < arguments.length; _i++) {\n" + - " durations[_i] = arguments[_i];\n" + - " }\n" + - " /* @DynamicProtoStub\n" + - " */\n" + - " return true;\n" + - "};\n", "// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\n"); - _this.doTest(null, " /**\n" + - " * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\n" + - " * Fall back to xhr sender if beacon is not supported.\n" + - " * @param {boolean} [async=true]\n" + - " * @memberof Initialization\n" + - " */\n" + - "Initialization.prototype.onunloadFlush = function (async) {\n" + - " if (async === void 0) { async = true; }\n" + - " /* @DynamicProtoStub\n" + - " */\n" + - "};\n", "// Removed Stub for Initialization.prototype.onunloadFlush.\n"); - } - }); - }; - return DynamicProtoRollupTests; - }(TestClass)); - exports.DynamicProtoRollupTests = DynamicProtoRollupTests; -}); -define("test/Selenium/DynamicProtoRollupTests", ["require", "exports", "test/DynamicProtoRollup.Tests"], function (require, exports, DynamicProtoRollup_Tests_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.runTests = void 0; - function runTests() { - new DynamicProtoRollup_Tests_1.DynamicProtoRollupTests().registerTests(); - } - exports.runTests = runTests; -}); -//# sourceMappingURL=dynamicprotorolluptests.js.map \ No newline at end of file diff --git a/rollup/test/Selenium/dynamicprotorolluptests.js.map b/rollup/test/Selenium/dynamicprotorolluptests.js.map deleted file mode 100644 index 6d144f9..0000000 --- a/rollup/test/Selenium/dynamicprotorolluptests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicprotorolluptests.js","sourceRoot":"","sources":["../TestFramework/Assert.ts","../TestFramework/TestCase.ts","../TestFramework/TestClass.ts","../TestFramework/Common.ts","../../src/removeDynamic.ts","../DynamicProtoRollup.Tests.ts","DynamicProtoRollupTests.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA+C;AAE/C;;;;GAIG;AACH;IAAA;IA2IA,CAAC;IA1IE;;;;;;;;;;;OAWG;IACY,gBAAS,GAAvB,UAAwB,QAAa,EAAE,MAAW,EAAE,OA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ErE,KAAI,CAAC,MAAM,CAAC,IAAI,EACZ,OAAO;wBACP,+EAA+E;wBAC/E,OAAO;wBACP,8EAA8E;wBAC9E,2BAA2B;wBAC3B,uDAAuD;wBACvD,0CAA0C;wBAC1C,SAAS;wBACT,4BAA4B;wBAC5B,UAAU;wBACV,oBAAoB;wBACpB,MAAM,EACN,mFAAmF,CAAC,CAAC;oBAEzF,KAAI,CAAC,MAAM,CAAC,IAAI,EACZ,WAAW;wBACX,mGAAmG;wBACnG,0DAA0D;wBAC1D,oCAAoC;wBACpC,+BAA+B;wBAC/B,OAAO;wBACP,+DAA+D;wBAC/D,8CAA8C;wBAC9C,4BAA4B;wBAC5B,UAAU;wBACV,MAAM,EACN,+DAA+D,CAAC,CAAC;gBACrE,CAAC;aACR,CAAC,CAAC;QACP,CAAC;QACL,8BAAC;IAAD,CAAC,AAppBD,CAA6C,SAAS,GAopBrD;IAppBY,0DAAuB;;;;;;ICFpC,SAAgB,QAAQ;QACpB,IAAI,kDAAuB,EAAE,CAAC,aAAa,EAAE,CAAC;IAClD,CAAC;IAFD,4BAEC","sourcesContent":["/// \n\n/** \n * Wrapper around QUnit asserts. This class has two purposes:\n * - Make Assertion methods easy to discover.\n * - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.\n */\nclass Assert {\n /**\n * A deep recursive comparison assertion, working on primitive types, arrays, objects, \n * regular expressions, dates and functions.\n *\n * The deepEqual() assertion can be used just like equal() when comparing the value of \n * objects, such that { key: value } is equal to { key: value }. For non-scalar values, \n * identity will be disregarded by deepEqual.\n *\n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static deepEqual(expected: any, actual: any, message?: string): any {\n return deepEqual(actual, expected, message);\n }\n\n /** \n * A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.\n *\n * The equal assertion uses the simple comparison operator (==) to compare the actual \n * and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails. \n * When it fails, both actual and expected values are displayed in the test result, \n * in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static equal(expected: any, actual: any, message?: string): any {\n return equal(actual, expected, message);\n }\n\n /**\n * An inverted deep recursive comparison assertion, working on primitive types, \n * arrays, objects, regular expressions, dates and functions.\n *\n * The notDeepEqual() assertion can be used just like equal() when comparing the \n * value of objects, such that { key: value } is equal to { key: value }. For non-scalar \n * values, identity will be disregarded by notDeepEqual.\n * \n * @param expected Known comparison value\n * @param actual Object or Expression being tested\n * @param message A short description of the assertion\n */\n public static notDeepEqual(expected: any, actual: any, message?: string): any {\n return notDeepEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notEqual assertion uses the simple inverted comparison operator (!=) to compare \n * the actual and expected arguments. When they aren't equal, the assertion passes: any; \n * otherwise, it fails. When it fails, both actual and expected values are displayed \n * in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notEqual(expected: any, actual: any, message?: string): any {\n return notEqual(actual, expected, message);\n }\n\n public static notPropEqual(expected: any, actual: any, message?: string): any {\n return notPropEqual(actual, expected, message);\n }\n\n public static propEqual(expected: any, actual: any, message?: string): any {\n return propEqual(actual, expected, message);\n }\n\n /**\n * A non-strict comparison assertion, checking for inequality.\n *\n * The notStrictEqual assertion uses the strict inverted comparison operator (!==) \n * to compare the actual and expected arguments. When they aren't equal, the assertion \n * passes: any; otherwise, it fails. When it fails, both actual and expected values are \n * displayed in the test result, in addition to a given message.\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static notStrictEqual(expected: any, actual: any, message?: string): any {\n return notStrictEqual(actual, expected, message);\n }\n\n /**\n * A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue(). \n * Passes if the first argument is truthy.\n *\n * The most basic assertion in QUnit, ok() requires just one argument. If the argument \n * evaluates to true, the assertion passes; otherwise, it fails. If a second message \n * argument is provided, it will be displayed in place of the result.\n * \n * @param state Expression being tested\n * @param message A short description of the assertion\n */\n public static ok(state: any, message?: string): any {\n return ok(state, message);\n }\n\n /**\n * A strict type and value comparison assertion.\n *\n * The strictEqual() assertion provides the most rigid comparison of type and value with \n * the strict equality operator (===)\n * \n * @param expected Known comparison value\n * @param actual Expression being tested\n * @param message A short description of the assertion\n */\n public static strictEqual(expected: any, actual: any, message?: string): any {\n return strictEqual(actual, expected, message);\n }\n\n /**\n * Assertion to test if a callback throws an exception when run.\n * \n * When testing code that is expected to throw an exception based on a specific set of \n * circumstances, use throws() to catch the error object for testing and comparison.\n * \n * @param block Function to execute\n * @param expected Error Object to compare\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, expected: any, message?: string): any;\n\n /**\n * @param block Function to execute\n * @param message A short description of the assertion\n */\n public static throws(block: () => any, message?: string): any;\n\n public static throws(block: () => any, expected?: any, message?: string): any {\n return throws(block, expected, message);\n }\n}","\n/** Defines a test case */\nclass TestCase {\n /** Name to use for the test case */\n public name: string;\n\n /** Test case method */\n public test: () => void;\n}\n\n\n/** Defines a test case */\ninterface TestCaseAsync {\n /** Name to use for the test case */\n name: string;\n\n /** time to wait after pre before invoking post and calling start() */\n stepDelay: number;\n\n /** async steps */\n steps: Array<() => void>;\n}","/// \n/// \n/// \n/// \n\nclass TestClass {\n\n constructor(name?: string) {\n QUnit.module(name);\n }\n\n public static isPollingStepFlag = \"isPollingStep\";\n\n /** The instance of the currently running suite. */\n public static currentTestClass: TestClass;\n\n /** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */\n public useFakeTimers: boolean = true;\n\n /** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */\n public useFakeServer: boolean = true;\n\n /** Method called before the start of each test method */\n public testInitialize() {\n }\n\n /** Method called after each test method has completed */\n public testCleanup() {\n }\n\n /** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */\n public registerTests() {\n }\n\n /** Register an async Javascript unit testcase. */\n public testCaseAsync(testInfo: TestCaseAsync) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (isNaN(testInfo.stepDelay)) {\n throw new Error(\"Must specify 'stepDelay' period between pre and post\");\n }\n\n if (!testInfo.steps) {\n throw new Error(\"Must specify 'steps' to take asynchronously\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = (assert) => {\n const done = assert.async();\n\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n const steps = testInfo.steps;\n const trigger = () => {\n if (steps.length) {\n const step = steps.shift();\n\n // The callback which activates the next test step. \n const nextTestStepTrigger = () => {\n setTimeout(() => {\n trigger();\n }, testInfo.stepDelay);\n };\n\n // There 2 types of test steps - simple and polling.\n // Upon completion of the simple test step the next test step will be called.\n // In case of polling test step the next test step is passed to the polling test step, and\n // it is responsibility of the polling test step to call the next test step.\n try {\n if (step[TestClass.isPollingStepFlag]) {\n step.call(this, nextTestStepTrigger);\n } else {\n step.call(this);\n nextTestStepTrigger.call(this);\n }\n } catch (e) {\n this._testCompleted();\n Assert.ok(false, e.toString());\n\n // done is QUnit callback indicating the end of the test\n done();\n\n return;\n }\n } else {\n this._testCompleted();\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n trigger();\n } catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n\n // done is QUnit callback indicating the end of the test\n done();\n }\n };\n\n // Register the test with QUnit\n QUnit.test(testInfo.name, testMethod);\n }\n\n /** Register a Javascript unit testcase. */\n public testCase(testInfo: TestCase) {\n if (!testInfo.name) {\n throw new Error(\"Must specify name in testInfo context in registerTestcase call\");\n }\n\n if (!testInfo.test) {\n throw new Error(\"Must specify 'test' method in testInfo context in registerTestcase call\");\n }\n\n // Create a wrapper around the test method so we can do test initilization and cleanup.\n const testMethod = () => {\n // Save off the instance of the currently running suite.\n TestClass.currentTestClass = this;\n\n // Run the test.\n try {\n this._testStarting();\n\n testInfo.test.call(this);\n\n this._testCompleted();\n }\n catch (ex) {\n Assert.ok(false, \"Unexpected Exception: \" + ex);\n this._testCompleted(true);\n }\n };\n\n // Register the test with QUnit\n test(testInfo.name, testMethod);\n }\n\n /** Called when the test is starting. */\n private _testStarting() {\n // Initialize the sandbox similar to what is done in sinon.js \"test()\" override. See note on class.\n const config = (sinon as any).getConfig(sinon.config);\n config.useFakeTimers = this.useFakeTimers;\n config.useFakeServer = this.useFakeServer;\n\n config.injectInto = config.injectIntoThis && this || config.injectInto;\n this.sandbox = sinon.sandbox.create(config);\n this.server = this.sandbox.server;\n\n // Allow the derived class to perform test initialization.\n this.testInitialize();\n }\n\n /** Called when the test is completed. */\n private _testCompleted(failed?: boolean) {\n if (failed) {\n // Just cleanup the sandbox since the test has already failed.\n this.sandbox.restore();\n }\n else {\n // Verify the sandbox and restore.\n (this.sandbox as any).verifyAndRestore();\n }\n\n this.testCleanup();\n\n // Clear the instance of the currently running suite.\n TestClass.currentTestClass = null;\n }\n\n /**** Sinon methods and properties ***/\n\n // These methods and properties are injected by Sinon and will override the implementation here.\n // These are here purely to make typescript happy.\n public clock: SinonFakeTimers;\n public server: SinonFakeServer;\n public sandbox: SinonSandbox;\n\n /** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */\n public spy(): SinonSpy;\n /** Spies on the provided function */\n public spy(funcToWrap: Function): SinonSpy;\n /** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */\n public spy(object: any, methodName: string, func?: Function): SinonSpy;\n public spy(...args: any[]): SinonSpy { return null; }\n\n /** Creates an anonymous stub function. */\n public stub(): SinonStub;\n /** Stubs all the object's methods. */\n public stub(object: any): SinonStub;\n /** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */\n public stub(object: any, methodName: string, func?: Function): SinonStub;\n public stub(...args: any[]): SinonStub { return null; }\n\n /** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */\n public mock(object: any): SinonMock { return null; }\n\n /**** end: Sinon methods and properties ***/\n\n /** Sends a JSON response to the provided request.\n * @param request The request to respond to.\n * @param data Data to respond with.\n * @param errorCode Optional error code to send with the request, default is 200\n */\n public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {\n if (errorCode === undefined) {\n errorCode = 200;\n }\n\n request.respond(\n errorCode,\n { \"Content-Type\": \"application/json\" },\n JSON.stringify(data));\n }\n\n protected setUserAgent(userAgent: string) {\n Object.defineProperty(window.navigator, 'userAgent',\n {\n configurable: true,\n get () {\n return userAgent;\n }\n });\n }\n}\n\n// Configure Sinon\nsinon.assert.fail = function (msg?) {\n Assert.ok(false, msg);\n};\n\nsinon.assert.pass = function (assertion) {\n Assert.ok(assertion, \"sinon assert\");\n};\n\nsinon.config = {\n injectIntoThis: true,\n injectInto: null,\n properties: [\"spy\", \"stub\", \"mock\", \"clock\", \"sandbox\"],\n useFakeTimers: true,\n useFakeServer: true\n};\n","/// \n/// \n/// \n/// \n/// ","import MagicString from 'magic-string';\n\nexport interface IDynamicProtoRollupOptions {\n tagname?: string,\n comment?:string,\n sourcemap?: boolean\n};\n\nfunction escape(str:string) {\n return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\n\nfunction isSourceMapEnabled(options:any) {\n if (options) {\n return options.sourceMap !== false && options.sourcemap !== false;\n }\n\n return false;\n}\n\n// Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always\n// exists in the build / test infrastructure\nfunction padEnd(input:string, len:number, fill:string) {\n let value = input||\"\";\n while (value.length < len) {\n value += fill;\n }\n\n if (value.length > len) {\n value = value.substring(0, len);\n }\n\n return value;\n}\n\nfunction isNullOrWhitespace(value:string) {\n if (value) {\n return value.replace(/\\s/g, \"\").length < 1;\n }\n\n return true;\n}\n\n/**\n * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to\n * remove the boilerplate code require by typescript to define methods as prototype level while\n * using @ms-dynamicProto project to support minification. This can also be used to remove \"debug\"\n * functions from the production code.\n */\nexport default function dynamicRemove(options:IDynamicProtoRollupOptions = {}) {\n var token = (options || {}).tagname || \"@DynamicProtoStub\";\n var replaceValue = (options || {}).comment || \"// Removed Stub for %function%.\";\n let tokenGroups:Array = [4, 10, 13];\n let funcNameGroup:number = 6;\n\n // Because of the test infrastructure (PhamtonJS) the RegEx can't use the \"s\" flag (gis vs gi) or named groups\n const pattern = new RegExp(\"([\\\\t ]*\\\\/\\\\*\\\\*((?!\\\\*\\\\/)(.|\\\\r|\\\\n))*\\\\*\\\\/[\\\\s]*)*(\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[\\\\t ]*([\\\\w]*\\\\.prototype(\\\\.|\\\\[\\\\\\\"|\\\\[\\\\')[\\\\w]*(\\\\\\\"\\\\]|\\\\'\\\\])?)[\\\\t ]*=[\\\\t ]*function[\\\\t ]*\\\\([^\\\\{]*\\\\{[^\\\\/\\\\}\\\\{]*(\\\\{[^\\\\}]*\\\\}[^\\\\/\\\\}\\\\{]*)*(\\\\/[\\\\*\\\\/][\\\\t ]*\" + escape(token) + \"[^\\\\*\\\\r\\\\n]*(\\\\*\\\\/)?(\\\\r\\\\n|\\\\n\\\\r|\\\\r|\\\\n))*[^\\\\}]*\\\\};([\\\\t ]*\\\\/\\\\/[\\\\t ]*\" + escape(token) + \"[^\\\\r\\\\n]*)*\", 'gi');\n\n function formatError(token:string, code:string, pos:number, id:string) {\n let lines = code.split(/(?:\\r\\n|\\n\\r|\\r|\\n)/);\n let lineNumber = 0;\n let count = pos;\n while (count > 0) {\n lineNumber ++;\n count = code.lastIndexOf(\"\\n\", count - 1);\n }\n \n let column = 0;\n let lineStart = code.lastIndexOf(\"\\n\", pos);\n if (lineStart != -1) {\n column = (pos - lineStart);\n } else {\n column = pos + 1;\n }\n \n var message = \"Invalid (Unremoved) token [\" + token + \"] found on line [\" + lineNumber + \"], column [\" + column + \"], position [\" + pos + \"] - \" + (id||\"\") + \"\\n\";\n \n let marker = padEnd(\"\", token.length, \"^\");\n let line = lineNumber - 6;\n if (line > 0) {\n message += \" ...\\n\";\n }\n \n count = 0;\n while (count < 10 && line < lines.length-1) {\n count++;\n if (line >= 0) {\n let number = padEnd(\"\" + (line + 1), 4, \" \");\n message += number + \":\" + lines[line] + \"\\n\";\n if (line == lineNumber-1) {\n message += padEnd(\"\", column + 4, \" \") + marker + \"\\n\";\n }\n }\n \n line++;\n }\n \n if (line < lines.length-1) {\n message += \" ...\\n\";\n }\n \n let match;\n let matchCount = 0;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n if (matchCount == 0) {\n message += \"\\nMatch checks\\n\";\n }\n\n matchCount++;\n if (match[0].length > 0) {\n message += \"Match \" + matchCount + \" tag Groups for \" + (funcName||\"\") + \"\\n\";\n message += \"--=( Complete Matched Content )=--\\n\";\n message += match[0];\n message += \"\\n--------------------------------\\n\";\n for(let lp = 1; lp < match.length; lp++) {\n if (match[lp]) {\n message += \"\" + lp + \": \" + (match[lp] || \"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n if ((match[lp]||\"\").indexOf(token) != -1) {\n message += \" <- Contains tag\";\n }\n message += \"\\n\";\n }\n }\n message += \"\\n\";\n }\n }\n }\n \n return message;\n }\n\n function replaceToken(code:string, theString:MagicString) {\n let result = false;\n let match;\n while ((match = pattern.exec(code))) {\n let funcName = match[funcNameGroup];\n if (!isNullOrWhitespace(funcName)) {\n // Only remove matches that contain a tag and function\n let hasToken = false;\n for(let lp = 0; lp < tokenGroups.length; lp++) {\n if ((match[tokenGroups[lp]]||\"\").indexOf(token) != -1) {\n hasToken = true;\n break;\n }\n }\n \n if (hasToken) {\n result = true;\n let start = match.index;\n let newValue = replaceValue.replace(\"%function%\", funcName);\n theString.overwrite(start, start + match[0].length, newValue);\n }\n }\n }\n\n return result;\n }\n\n function checkResult(result:string, id:string) {\n if (result) {\n let pos = result.indexOf(token);\n if (pos != -1) {\n throw new Error(formatError(token, result, pos, id));\n }\n }\n }\n\n function doTransform(code:string, id:string) {\n let theString = new MagicString(code);\n if (!replaceToken(code, theString)) {\n return null;\n }\n\n let result:any = { code: theString.toString() };\n if (isSourceMapEnabled(options)) {\n result.map = theString.generateMap({hires: true});\n }\n\n return result;\n }\n\n function doTransformAndCheck(code:string, id:string) {\n let result = doTransform(code, id);\n if (result) {\n // Do a final check of the string\n checkResult(result.code, id);\n } else {\n // Check that the raw input doesn't include the tag\n checkResult(code, id);\n }\n\n return result;\n }\n\n return {\n name: 'dynamicRemove',\n renderChunk(code:string, chunk:any) {\n return doTransformAndCheck(code, chunk.filename);\n },\n transform: doTransformAndCheck\n }\n}\n \n ","/// \n\nimport dynamicRemove from '../src/removeDynamic';\n\nexport class DynamicProtoRollupTests extends TestClass {\n\n public testInitialize() {\n }\n\n private visibleNewlines(value) {\n if (value) {\n return value.replace(/\\r/g, \"\\\\r\").replace(/\\n/g, \"\\\\n\");\n }\n\n return value;\n }\n\n private convertNewlines(value, newline) {\n if (value) {\n return value.replace(/\\n/g, newline);\n }\n\n return value;\n }\n\n private testNoChange(options:any, input:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n QUnit.assert.equal(plugin.renderChunk(input, { filename: \"test.js\" }), null);\n QUnit.assert.equal(plugin.transform(input, \"testId\"), null);\n }\n\n private doTest(options:any, input:string, expected:string) {\n this.testExpected(options, input, expected);\n this.testExpected(options, this.convertNewlines(input, \"\\r\"), this.convertNewlines(expected, \"\\r\"));\n this.testExpected(options, this.convertNewlines(input, \"\\r\\n\"), this.convertNewlines(expected, \"\\r\\n\"));\n this.testExpected(options, this.convertNewlines(input, \"\\n\\r\"), this.convertNewlines(expected, \"\\n\\r\"));\n }\n\n private testExpected(options:any, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.equal(plugin.name, \"dynamicRemove\");\n let result = plugin.renderChunk(input, { filename: \"test.js\" });\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n\n result = plugin.transform(input, \"testId\");\n QUnit.assert.equal(result != null ? result.code : null, expected, this.visibleNewlines(result != null ? result.code : null));\n }\n\n private testError(options:any, message:string, input:string, expected:string) {\n let plugin = dynamicRemove(options);\n\n QUnit.assert.throws(() => {\n plugin.renderChunk(input, { filename: \"test.js\" });\n }, new Error(expected), message);\n\n QUnit.assert.throws(() => {\n plugin.transform(input, \"test.js\");\n }, new Error(expected), message);\n }\n\n public registerTests() {\n this.testCase({\n name: \"No matching values for removal\",\n test: () => {\n this.testNoChange(null, \"Nothing removed\");\n\n this.testNoChange(null, \"ClassName.prototype.anotherMethod = function () {\\n};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n\n this.testNoChange(null, \n \"// @Stub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" // @Stub -- Type 2 single line comment\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment */\\n\" +\n \"};\\n\");\n \n this.testNoChange(null, \n \"function methodName() {\\n\" +\n \" /* @Stub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\");\n }\n });\n\n this.testCase({\n name: \"Basic tag patterns\",\n test: () => {\n this.doTest(null, \n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.doTest(null, \n \"ClassName.prototype.methodName = function () {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\", \n \"// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n this.testCase({\n name: \"Mixed tagtype combinations\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.testExpected(null, \n // Input, \n \" /**\\r\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\\n\" + \n \" * @param coreConfig - The core configuration.\\r\\n\" + \n \" * @param core - The AppInsights core.\\r\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\r\\n\" + \n \" */\\r\\n\" + \n \" // @DynamicProtoStub \\r\\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\r\\n\" + \n \" };\\r\\n\" + \n \" /**\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\r\" + \n \" * @param coreConfig - The core configuration.\\r\" + \n \" * @param core - The AppInsights core.\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\r\" + \n \" */\\r\" + \n \" // @DynamicProtoStub \\r\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\r\" + \n \" };\\r\" + \n \" /**\\n\\r\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\\r\" + \n \" * @param coreConfig - The core configuration.\\n\\r\" + \n \" * @param core - The AppInsights core.\\n\\r\" + \n \" * @param extensions - An array of all the plugins being used.\\n\\r\" + \n \" */\\n\\r\" + \n \" // @DynamicProtoStub \\n\\r\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\\r\" + \n \" };\\n\\r\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\r\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\r\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\\r\"\n );\n }\n });\n\n this.testCase({\n name: \"Stubs with return values\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func2 = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func4 = function (evt, itemCtx) {\\n\" + \n \" // @DynamicProtoStub - Tag type 2.1\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func6 = function (evt, itemCtx) {\\n\" + \n \" /* @DynamicProtoStub - Tag type 2.2 */\\n\" +\n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype.func1.\\n\" + \n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype.func3 = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func4.\\n\" + \n \" TestClass.prototype.func5 = function () {\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \"// Removed Stub for TestClass.prototype.func6.\\n\" + \n \" return TestClass;\"\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func1 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func2 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype.func3 = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype.func1.\\n\" +\n \"// Removed Stub for TestClass.prototype.func2.\\n\" + \n \"// Removed Stub for TestClass.prototype.func3.\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test reserved (ES3) function names\",\n test: () => {\n this.doTest(null, \n // Input, \n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" };\\n\" + \n \" /**\\n\" + \n \" * Process an event to add it to the local storage and then pass it to the next plugin.\\n\" + \n \" * @param event - The event that needs to be stored.\\n\" + \n \" * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\\n\" + \n \" * can optionally use this to access the current core instance or define / pass additional information\\n\" + \n \" * to later plugins (vs appending items to the telemetry item)\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"catch2\\\"] = function (evt, itemCtx) {\\n\" + \n \" return;\\n\" +\n \" }; // @DynamicProtoStub - Tag type 3\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" + \n \" return TestClass;\",\n // Expected Value\n \" /* ================================================================================================================\\n\" + \n \" * DO NOT add any code to these empty implementations as any code defined here will be removed, as\\n\" + \n \" /*\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"catch2\\\"].\\n\" + \n \" /**\\n\" + \n \" * Hello World\\n\" + \n \" */\\n\" + \n \" TestClass.prototype[\\\"func3\\\"] = function () {\\n\" + \n \" // Normal Function\\n\" + \n \" return;\\n\" +\n \" };\\n\" +\n \" return TestClass;\",\n );\n\n this.doTest(null, \n // Input, \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"catch\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"delete\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype[\\\"throw\\\"] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \" /**\\n\" + \n \" * The function does the initial set up. It adds a notification listener to determine which events to remove.\\n\" + \n \" * @param coreConfig - The core configuration.\\n\" + \n \" * @param core - The AppInsights core.\\n\" + \n \" * @param extensions - An array of all the plugins being used.\\n\" + \n \" */\\n\" + \n \" // @DynamicProtoStub \\n\" + \n \" TestClass.prototype['if'] = function (coreConfig, core, extensions, pluginChain) {\\n\" + \n \" throw \\\"Not Implemented\\\";\\n\" +\n \" };\\n\" + \n \"\",\n // Expected Value\n \"// Removed Stub for TestClass.prototype[\\\"catch\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype[\\\"delete\\\"].\\n\" + \n \"// Removed Stub for TestClass.prototype[\\\"throw\\\"].\\n\" +\n \"// Removed Stub for TestClass.prototype['if'].\\n\"\n );\n }\n });\n\n this.testCase({\n name: \"Test unconverted tags from partial conversion\",\n test: () => {\n this.testError(null, \n \"1 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\");\n \n this.testError(null, \n \"2 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"3 -- Type 2 multiline comment\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\");\n \n this.testError(null,\n \"4 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\");\n\n this.testError(null,\n \"5 -- Type 1 comment\",\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"function methodName() {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [1], column [4], position [3] - test.js\\n\" +\n \"1 :// @DynamicProtoStub -- Type 1 comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"2 :function methodName() {\\n\" +\n \"3 : // This is a comment for a dynamic proto stub\\n\" +\n \"4 :};\\n\" +\n \"5 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n\n \n this.testError(null,\n \"6 -- Type 2 single line comment\",\n \"function methodName() {\\n\" +\n \" // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : // @DynamicProtoStub -- Type 2 single line comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"7 -- Type 2 multiline comment */\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment */\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 :};\\n\" +\n \"4 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n \n this.testError(null,\n \"8 -- Type 2 multiline comment (2)\",\n \"function methodName() {\\n\" +\n \" /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" * Continuation of a multi-line comment/\\n\" +\n \" */\\n\" +\n \"};\\n\" +\n \"// @DynamicProtoStub -- Type 1 comment\\n\" +\n \"ClassName.prototype.methodName = function () {\\n\" +\n \" // This is a comment for a dynamic proto stub\\n\" +\n \"};\\n\",\n \"Invalid (Unremoved) token [@DynamicProtoStub] found on line [2], column [8], position [31] - test.js\\n\" +\n \"1 :function methodName() {\\n\" +\n \"2 : /* @DynamicProtoStub -- Type 2 multiline comment\\n\" +\n \" ^^^^^^^^^^^^^^^^^\\n\" +\n \"3 : * Continuation of a multi-line comment/\\n\" +\n \"4 : */\\n\" +\n \"5 :};\\n\" +\n \"6 :// Removed Stub for ClassName.prototype.methodName.\\n\");\n }\n });\n\n\n this.testCase({\n name: \"Test prefixed comment with typescript boilerplate for spread and default arguments\",\n test: () => {\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" // @DynamicProtoStub\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" // @DynamicProtoStub\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n\n this.doTest(null, \n \"/**\\n\" +\n \" * This method tells if given durations should be excluded from collection.\\n\" +\n \" */\\n\" +\n \"PageViewPerformanceManager.prototype.shouldCollectDuration = function () {\\n\" +\n \" var durations = [];\\n\" +\n \" for (var _i = 0; _i < arguments.length; _i++) {\\n\" +\n \" durations[_i] = arguments[_i];\\n\" +\n \" }\\n\" +\n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \" return true;\\n\" +\n \"};\\n\",\n \"// Removed Stub for PageViewPerformanceManager.prototype.shouldCollectDuration.\\n\");\n\n this.doTest(null,\n \" /**\\n\" + \n \" * Manually trigger an immediate send of all telemetry still in the buffer using beacon Sender.\\n\" + \n \" * Fall back to xhr sender if beacon is not supported.\\n\" + \n \" * @param {boolean} [async=true]\\n\" + \n \" * @memberof Initialization\\n\" + \n \" */\\n\" + \n \"Initialization.prototype.onunloadFlush = function (async) {\\n\" + \n \" if (async === void 0) { async = true; }\\n\" + \n \" /* @DynamicProtoStub\\n\" +\n \" */\\n\" +\n \"};\\n\",\n \"// Removed Stub for Initialization.prototype.onunloadFlush.\\n\");\n }\n });\n }\n}\n","import { DynamicProtoRollupTests } from '../DynamicProtoRollup.Tests';\n\nexport function runTests() {\n new DynamicProtoRollupTests().registerTests();\n}\n"]} \ No newline at end of file From cdbc572f9ca31f72a4628d76c746bac2049b4d17 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 22:43:59 +0000 Subject: [PATCH 21/22] Update documentation to reflect current implementation approach Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fab2795..d9f389a 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ So whether creating a new class or extending some other class/code, your resulti The version 2.x is maintained on the default [main branch](https://github.com/microsoft/DynamicProto-JS/tree/main) -## Server-Side Rendering Support +## Restricted Environment Support -As of version 2.0.4, DynamicProto-JS includes support for restricted JavaScript environments, including Cloudflare Workers and some Angular SSR environments. In these contexts, the library automatically detects environments where property redefinition is restricted and provides simplified functionality that avoids operations that would cause issues. +As of version 2.0.4, DynamicProto-JS includes support for restricted JavaScript environments, including Cloudflare Workers and some Angular SSR environments. In these contexts, the library handles potential property manipulation errors that might occur in environments with stricter JavaScript execution rules. This ensures compatibility with Angular SSR, Cloudflare Workers, and other restricted environments without requiring additional configuration. From 5509384ef10c71bba1d3c3cd3b0448a84a9183de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 22:48:58 +0000 Subject: [PATCH 22/22] Remove Restricted Environment Support section from README.md Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com> --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index d9f389a..54e4039 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,6 @@ So whether creating a new class or extending some other class/code, your resulti The version 2.x is maintained on the default [main branch](https://github.com/microsoft/DynamicProto-JS/tree/main) -## Restricted Environment Support - -As of version 2.0.4, DynamicProto-JS includes support for restricted JavaScript environments, including Cloudflare Workers and some Angular SSR environments. In these contexts, the library handles potential property manipulation errors that might occur in environments with stricter JavaScript execution rules. - -This ensures compatibility with Angular SSR, Cloudflare Workers, and other restricted environments without requiring additional configuration. ## Documentation