From 68a7cbb991e16e08753fff94a69200ec2893a158 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sun, 5 Oct 2025 06:53:54 -0700 Subject: [PATCH] Adopt strict mode throughout the codebase --- lib/jasmine-core.js | 2 + lib/jasmine-core/boot0.js | 2 + lib/jasmine-core/boot1.js | 2 + lib/jasmine-core/jasmine-html.js | 10 + lib/jasmine-core/jasmine.js | 205 ++++++++++++++++++ src/boot/boot0.js | 2 + src/boot/boot1.js | 2 + src/boot/jasmine-core.js | 2 + src/core/CallTracker.js | 2 + src/core/ClearStack.js | 2 + src/core/Clock.js | 2 + src/core/CompleteOnFirstErrorSkipPolicy.js | 2 + src/core/Configuration.js | 2 + src/core/CurrentRunableTracker.js | 2 + src/core/Deprecator.js | 2 + src/core/Env.js | 2 + src/core/ExceptionFormatter.js | 2 + src/core/Expectation.js | 2 + src/core/ExpectationFilterChain.js | 2 + src/core/Expector.js | 2 + src/core/GlobalErrors.js | 2 + src/core/JsApiReporter.js | 2 + src/core/MockDate.js | 2 + src/core/NeverSkipPolicy.js | 2 + src/core/Order.js | 2 + src/core/PrettyPrinter.js | 2 + src/core/QueueRunner.js | 2 + src/core/RunableResources.js | 2 + src/core/Runner.js | 2 + src/core/SkipAfterBeforeAllErrorPolicy.js | 2 + src/core/Spec.js | 2 + src/core/Spy.js | 2 + src/core/SpyFactory.js | 2 + src/core/SpyStrategy.js | 2 + src/core/StackTrace.js | 2 + src/core/Suite.js | 2 + src/core/SuiteBuilder.js | 2 + src/core/Timer.js | 2 + src/core/TreeProcessor.js | 2 + src/core/TreeRunner.js | 2 + src/core/UserContext.js | 2 + src/core/asymmetric_equality/Any.js | 2 + src/core/asymmetric_equality/Anything.js | 2 + .../asymmetric_equality/ArrayContaining.js | 2 + .../ArrayWithExactContents.js | 2 + src/core/asymmetric_equality/Empty.js | 2 + src/core/asymmetric_equality/Falsy.js | 2 + src/core/asymmetric_equality/Is.js | 2 + src/core/asymmetric_equality/MapContaining.js | 2 + src/core/asymmetric_equality/NotEmpty.js | 2 + .../asymmetric_equality/ObjectContaining.js | 2 + src/core/asymmetric_equality/SetContaining.js | 2 + .../asymmetric_equality/StringContaining.js | 2 + .../asymmetric_equality/StringMatching.js | 2 + src/core/asymmetric_equality/Truthy.js | 2 + src/core/base.js | 2 + src/core/buildExpectationResult.js | 2 + src/core/errors.js | 2 + src/core/formatErrorMsg.js | 2 + src/core/matchers/DiffBuilder.js | 2 + src/core/matchers/MismatchTree.js | 2 + src/core/matchers/NullDiffBuilder.js | 2 + src/core/matchers/ObjectPath.js | 2 + src/core/matchers/async/toBePending.js | 2 + src/core/matchers/async/toBeRejected.js | 2 + src/core/matchers/async/toBeRejectedWith.js | 2 + .../matchers/async/toBeRejectedWithError.js | 2 + src/core/matchers/async/toBeResolved.js | 2 + src/core/matchers/async/toBeResolvedTo.js | 2 + src/core/matchers/matchersUtil.js | 2 + src/core/matchers/nothing.js | 2 + src/core/matchers/requireAsyncMatchers.js | 2 + src/core/matchers/requireMatchers.js | 2 + src/core/matchers/toBe.js | 2 + src/core/matchers/toBeCloseTo.js | 2 + src/core/matchers/toBeDefined.js | 2 + src/core/matchers/toBeFalse.js | 2 + src/core/matchers/toBeFalsy.js | 2 + src/core/matchers/toBeGreaterThan.js | 2 + src/core/matchers/toBeGreaterThanOrEqual.js | 2 + src/core/matchers/toBeInstanceOf.js | 2 + src/core/matchers/toBeLessThan.js | 2 + src/core/matchers/toBeLessThanOrEqual.js | 2 + src/core/matchers/toBeNaN.js | 2 + src/core/matchers/toBeNegativeInfinity.js | 2 + src/core/matchers/toBeNull.js | 2 + src/core/matchers/toBeNullish.js | 2 + src/core/matchers/toBePositiveInfinity.js | 2 + src/core/matchers/toBeTrue.js | 2 + src/core/matchers/toBeTruthy.js | 2 + src/core/matchers/toBeUndefined.js | 2 + src/core/matchers/toContain.js | 2 + src/core/matchers/toEqual.js | 2 + src/core/matchers/toHaveBeenCalled.js | 2 + src/core/matchers/toHaveBeenCalledBefore.js | 2 + src/core/matchers/toHaveBeenCalledOnceWith.js | 2 + src/core/matchers/toHaveBeenCalledTimes.js | 2 + src/core/matchers/toHaveBeenCalledWith.js | 2 + src/core/matchers/toHaveClass.js | 2 + src/core/matchers/toHaveClasses.js | 2 + .../matchers/toHaveNoOtherSpyInteractions.js | 2 + src/core/matchers/toHaveSize.js | 2 + src/core/matchers/toHaveSpyInteractions.js | 2 + src/core/matchers/toMatch.js | 2 + src/core/matchers/toThrow.js | 2 + src/core/matchers/toThrowError.js | 2 + src/core/matchers/toThrowMatching.js | 2 + src/core/reporterEvents.js | 2 + src/core/requireCore.js | 1 + src/core/requireInterface.js | 2 + src/core/util.js | 2 + src/html/HtmlExactSpecFilter.js | 2 + src/html/HtmlReporter.js | 2 + src/html/HtmlSpecFilter.js | 2 + src/html/QueryString.js | 2 + src/html/ResultsNode.js | 2 + 116 files changed, 442 insertions(+) diff --git a/lib/jasmine-core.js b/lib/jasmine-core.js index 326ccab1..6efa2367 100644 --- a/lib/jasmine-core.js +++ b/lib/jasmine-core.js @@ -22,6 +22,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +'use strict'; + /** * Note: Only available on Node. * @module jasmine-core diff --git a/lib/jasmine-core/boot0.js b/lib/jasmine-core/boot0.js index 5403bdf3..53887758 100644 --- a/lib/jasmine-core/boot0.js +++ b/lib/jasmine-core/boot0.js @@ -22,6 +22,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +'use strict'; + /** This file starts the process of "booting" Jasmine. It initializes Jasmine, makes its globals available, and creates the env. This file should be loaded diff --git a/lib/jasmine-core/boot1.js b/lib/jasmine-core/boot1.js index c1bf086b..b91a1a75 100644 --- a/lib/jasmine-core/boot1.js +++ b/lib/jasmine-core/boot1.js @@ -22,6 +22,8 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +'use strict'; + /** This file finishes 'booting' Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index 767951a4..1a45ff0d 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -34,6 +34,8 @@ jasmineRequire.html = function(j$) { }; jasmineRequire.HtmlReporter = function(j$) { + 'use strict'; + function ResultsStateBuilder() { this.topResults = new j$.private.ResultsNode({}, '', null); this.currentParent = this.topResults; @@ -907,6 +909,8 @@ jasmineRequire.HtmlReporter = function(j$) { }; jasmineRequire.HtmlSpecFilter = function() { + 'use strict'; + /** * @name HtmlSpecFilter * @classdesc Legacy HTML spec filter, for backward compatibility @@ -946,6 +950,8 @@ jasmineRequire.HtmlSpecFilter = function() { }; jasmineRequire.ResultsNode = function() { + 'use strict'; + function ResultsNode(result, type, parent) { this.result = result; this.type = type; @@ -970,6 +976,8 @@ jasmineRequire.ResultsNode = function() { }; jasmineRequire.QueryString = function() { + 'use strict'; + /** * Reads and manipulates the query string. * @since 2.0.0 @@ -1054,6 +1062,8 @@ jasmineRequire.QueryString = function() { }; jasmineRequire.HtmlExactSpecFilter = function() { + 'use strict'; + /** * Spec filter for use with {@link HtmlReporter} * diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index ba0dd4a3..5220ab23 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -24,6 +24,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // eslint-disable-next-line no-unused-vars,no-var var getJasmineRequireObj = (function(jasmineGlobal) { + 'use strict'; let jasmineRequire; if ( @@ -134,6 +135,8 @@ var getJasmineRequireObj = (function(jasmineGlobal) { })(this); getJasmineRequireObj().requireMatchers = function(jRequire, j$) { + 'use strict'; + const availableMatchers = [ 'nothing', 'toBe', @@ -181,6 +184,8 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) { }; getJasmineRequireObj().base = function(j$, jasmineGlobal) { + 'use strict'; + /** * Maximum object depth the pretty printer will print to. * Set this to a lower value to speed up pretty printing if you have large objects. @@ -680,6 +685,8 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { }; getJasmineRequireObj().util = function(j$) { + 'use strict'; + const util = {}; util.clone = function(obj) { @@ -776,6 +783,8 @@ getJasmineRequireObj().util = function(j$) { }; getJasmineRequireObj().Spec = function(j$) { + 'use strict'; + class Spec { #autoCleanClosures; #throwOnExpectationFailure; @@ -1146,6 +1155,8 @@ getJasmineRequireObj().Spec = function(j$) { }; getJasmineRequireObj().Order = function() { + 'use strict'; + function Order(options) { this.random = 'random' in options ? options.random : true; const seed = (this.seed = options.seed || generateSeed()); @@ -1190,6 +1201,8 @@ getJasmineRequireObj().Order = function() { }; getJasmineRequireObj().Env = function(j$) { + 'use strict'; + /** * @class Env * @since 2.0.0 @@ -2007,6 +2020,8 @@ getJasmineRequireObj().Env = function(j$) { }; getJasmineRequireObj().JsApiReporter = function(j$) { + 'use strict'; + /** * @name jsApiReporter * @classdesc {@link Reporter} added by default in `boot.js` to record results for retrieval in javascript code. An instance is made available as `jsApiReporter` on the global object. @@ -2137,6 +2152,8 @@ getJasmineRequireObj().JsApiReporter = function(j$) { }; getJasmineRequireObj().Any = function(j$) { + 'use strict'; + function Any(expectedObject) { if (typeof expectedObject === 'undefined') { throw new TypeError( @@ -2183,6 +2200,8 @@ getJasmineRequireObj().Any = function(j$) { }; getJasmineRequireObj().Anything = function(j$) { + 'use strict'; + function Anything() {} Anything.prototype.asymmetricMatch = function(other) { @@ -2197,6 +2216,8 @@ getJasmineRequireObj().Anything = function(j$) { }; getJasmineRequireObj().ArrayContaining = function(j$) { + 'use strict'; + function ArrayContaining(sample) { this.sample = sample; } @@ -2234,6 +2255,8 @@ getJasmineRequireObj().ArrayContaining = function(j$) { }; getJasmineRequireObj().ArrayWithExactContents = function(j$) { + 'use strict'; + function ArrayWithExactContents(sample) { this.sample = sample; } @@ -2271,6 +2294,8 @@ getJasmineRequireObj().ArrayWithExactContents = function(j$) { }; getJasmineRequireObj().Empty = function(j$) { + 'use strict'; + function Empty() {} Empty.prototype.asymmetricMatch = function(other) { @@ -2300,6 +2325,8 @@ getJasmineRequireObj().Empty = function(j$) { }; getJasmineRequireObj().Falsy = function(j$) { + 'use strict'; + function Falsy() {} Falsy.prototype.asymmetricMatch = function(other) { @@ -2314,6 +2341,8 @@ getJasmineRequireObj().Falsy = function(j$) { }; getJasmineRequireObj().Is = function(j$) { + 'use strict'; + class Is { constructor(expected) { this.expected_ = expected; @@ -2332,6 +2361,8 @@ getJasmineRequireObj().Is = function(j$) { }; getJasmineRequireObj().MapContaining = function(j$) { + 'use strict'; + function MapContaining(sample) { if (!j$.private.isMap(sample)) { throw new Error( @@ -2378,6 +2409,8 @@ getJasmineRequireObj().MapContaining = function(j$) { }; getJasmineRequireObj().NotEmpty = function(j$) { + 'use strict'; + function NotEmpty() {} NotEmpty.prototype.asymmetricMatch = function(other) { @@ -2408,6 +2441,8 @@ getJasmineRequireObj().NotEmpty = function(j$) { }; getJasmineRequireObj().ObjectContaining = function(j$) { + 'use strict'; + function ObjectContaining(sample) { this.sample = sample; } @@ -2477,6 +2512,8 @@ getJasmineRequireObj().ObjectContaining = function(j$) { }; getJasmineRequireObj().SetContaining = function(j$) { + 'use strict'; + function SetContaining(sample) { if (!j$.private.isSet(sample)) { throw new Error( @@ -2521,6 +2558,8 @@ getJasmineRequireObj().SetContaining = function(j$) { }; getJasmineRequireObj().StringContaining = function(j$) { + 'use strict'; + function StringContaining(expected) { if (!j$.private.isString(expected)) { throw new Error('Expected is not a String'); @@ -2546,6 +2585,8 @@ getJasmineRequireObj().StringContaining = function(j$) { }; getJasmineRequireObj().StringMatching = function(j$) { + 'use strict'; + function StringMatching(expected) { if (!j$.private.isString(expected) && !j$.private.isA('RegExp', expected)) { throw new Error('Expected is not a String or a RegExp'); @@ -2566,6 +2607,8 @@ getJasmineRequireObj().StringMatching = function(j$) { }; getJasmineRequireObj().Truthy = function(j$) { + 'use strict'; + function Truthy() {} Truthy.prototype.asymmetricMatch = function(other) { @@ -2581,6 +2624,8 @@ getJasmineRequireObj().Truthy = function(j$) { //TODO: expectation result may make more sense as a presentation of an expectation. getJasmineRequireObj().buildExpectationResult = function(j$) { + 'use strict'; + function buildExpectationResult(options) { const exceptionFormatter = new j$.private.ExceptionFormatter(); @@ -2662,6 +2707,8 @@ getJasmineRequireObj().buildExpectationResult = function(j$) { }; getJasmineRequireObj().CallTracker = function(j$) { + 'use strict'; + /** * @namespace Spy#calls * @since 2.0.0 @@ -2802,6 +2849,8 @@ getJasmineRequireObj().CallTracker = function(j$) { }; getJasmineRequireObj().clearStack = function(j$) { + 'use strict'; + const maxInlineCallCount = 10; function browserQueueMicrotaskImpl(global) { @@ -2925,6 +2974,8 @@ getJasmineRequireObj().clearStack = function(j$) { }; getJasmineRequireObj().Clock = function() { + 'use strict'; + /* global process */ const NODE_JS = typeof process !== 'undefined' && @@ -3272,6 +3323,8 @@ callbacks to execute _before_ running the next one. }; getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) { + 'use strict'; + function CompleteOnFirstErrorSkipPolicy(queueableFns) { this.queueableFns_ = queueableFns; this.erroredFnIx_ = null; @@ -3324,6 +3377,8 @@ getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) { }; getJasmineRequireObj().Configuration = function(j$) { + 'use strict'; + /** * This represents the available options to configure Jasmine. * Options that are not provided will use their default values. @@ -3506,6 +3561,8 @@ getJasmineRequireObj().Configuration = function(j$) { }; getJasmineRequireObj().CurrentRunableTracker = function() { + 'use strict'; + class CurrentRunableTracker { #currentSpec; #currentlyExecutingSuites; @@ -3755,6 +3812,8 @@ getJasmineRequireObj().DelayedFunctionScheduler = function(j$) { }; getJasmineRequireObj().Deprecator = function(j$) { + 'use strict'; + function Deprecator(topSuite) { this.topSuite_ = topSuite; this.verbose_ = false; @@ -3848,6 +3907,8 @@ getJasmineRequireObj().Deprecator = function(j$) { }; getJasmineRequireObj().errors = function() { + 'use strict'; + function ExpectationFailed() {} ExpectationFailed.prototype = new Error(); @@ -3859,6 +3920,8 @@ getJasmineRequireObj().errors = function() { }; getJasmineRequireObj().ExceptionFormatter = function(j$) { + 'use strict'; + const ignoredProperties = [ 'name', 'message', @@ -3984,6 +4047,8 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) { }; getJasmineRequireObj().Expectation = function(j$) { + 'use strict'; + /** * Matchers that come with Jasmine out of the box. * @namespace matchers @@ -4252,6 +4317,8 @@ getJasmineRequireObj().Expectation = function(j$) { }; getJasmineRequireObj().ExpectationFilterChain = function() { + 'use strict'; + function ExpectationFilterChain(maybeFilter, prev) { this.filter_ = maybeFilter; this.prev_ = prev; @@ -4302,6 +4369,8 @@ getJasmineRequireObj().ExpectationFilterChain = function() { }; getJasmineRequireObj().Expector = function(j$) { + 'use strict'; + function Expector(options) { this.matchersUtil = options.matchersUtil || { buildFailureMessage: function() {} @@ -4394,6 +4463,8 @@ getJasmineRequireObj().Expector = function(j$) { }; getJasmineRequireObj().formatErrorMsg = function() { + 'use strict'; + function generateErrorMsg(domain, usage) { const usageDefinition = usage ? '\nUsage: ' + usage : ''; @@ -4406,6 +4477,8 @@ getJasmineRequireObj().formatErrorMsg = function() { }; getJasmineRequireObj().GlobalErrors = function(j$) { + 'use strict'; + class GlobalErrors { #getConfig; #adapter; @@ -4708,6 +4781,8 @@ getJasmineRequireObj().GlobalErrors = function(j$) { }; getJasmineRequireObj().toBePending = function(j$) { + 'use strict'; + /** * Expect a promise to be pending, i.e. the promise is neither resolved nor rejected. * @function @@ -4740,6 +4815,8 @@ getJasmineRequireObj().toBePending = function(j$) { }; getJasmineRequireObj().toBeRejected = function(j$) { + 'use strict'; + /** * Expect a promise to be rejected. * @function @@ -4773,6 +4850,8 @@ getJasmineRequireObj().toBeRejected = function(j$) { }; getJasmineRequireObj().toBeRejectedWith = function(j$) { + 'use strict'; + /** * Expect a promise to be rejected with a value equal to the expected, using deep equality comparison. * @function @@ -4834,6 +4913,8 @@ getJasmineRequireObj().toBeRejectedWith = function(j$) { }; getJasmineRequireObj().toBeRejectedWithError = function(j$) { + 'use strict'; + /** * Expect a promise to be rejected with a value matched to the expected * @function @@ -4957,6 +5038,8 @@ getJasmineRequireObj().toBeRejectedWithError = function(j$) { }; getJasmineRequireObj().toBeResolved = function(j$) { + 'use strict'; + /** * Expect a promise to be resolved. * @function @@ -4998,6 +5081,8 @@ getJasmineRequireObj().toBeResolved = function(j$) { }; getJasmineRequireObj().toBeResolvedTo = function(j$) { + 'use strict'; + /** * Expect a promise to be resolved to a value equal to the expected, using deep equality comparison. * @function @@ -5063,6 +5148,8 @@ getJasmineRequireObj().toBeResolvedTo = function(j$) { }; getJasmineRequireObj().DiffBuilder = function(j$) { + 'use strict'; + class DiffBuilder { constructor(config) { this.prettyPrinter_ = @@ -5177,6 +5264,8 @@ getJasmineRequireObj().DiffBuilder = function(j$) { }; getJasmineRequireObj().MatchersUtil = function(j$) { + 'use strict'; + /** * @class MatchersUtil * @classdesc Utilities for use in implementing matchers.
@@ -5862,6 +5951,8 @@ getJasmineRequireObj().MatchersUtil = function(j$) { */ getJasmineRequireObj().MismatchTree = function(j$) { + 'use strict'; + /* To be able to apply custom object formatters at all possible levels of an object graph, DiffBuilder needs to be able to know not just where the @@ -5919,6 +6010,8 @@ getJasmineRequireObj().MismatchTree = function(j$) { }; getJasmineRequireObj().nothing = function() { + 'use strict'; + /** * {@link expect} nothing explicitly. * @function @@ -5941,6 +6034,8 @@ getJasmineRequireObj().nothing = function() { }; getJasmineRequireObj().NullDiffBuilder = function(j$) { + 'use strict'; + return function() { return { withPath: function(_, block) { @@ -5953,6 +6048,8 @@ getJasmineRequireObj().NullDiffBuilder = function(j$) { }; getJasmineRequireObj().ObjectPath = function(j$) { + 'use strict'; + class ObjectPath { constructor(components) { this.components = components || []; @@ -5999,6 +6096,8 @@ getJasmineRequireObj().ObjectPath = function(j$) { }; getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) { + 'use strict'; + const availableMatchers = [ 'toBePending', 'toBeResolved', @@ -6017,6 +6116,8 @@ getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) { }; getJasmineRequireObj().toBe = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `===` to the expected value. * @function @@ -6055,6 +6156,8 @@ getJasmineRequireObj().toBe = function(j$) { }; getJasmineRequireObj().toBeCloseTo = function() { + 'use strict'; + /** * {@link expect} the actual value to be within a specified precision of the expected value. * @function @@ -6106,6 +6209,8 @@ getJasmineRequireObj().toBeCloseTo = function() { }; getJasmineRequireObj().toBeDefined = function() { + 'use strict'; + /** * {@link expect} the actual value to be defined. (Not `undefined`) * @function @@ -6128,6 +6233,8 @@ getJasmineRequireObj().toBeDefined = function() { }; getJasmineRequireObj().toBeFalse = function() { + 'use strict'; + /** * {@link expect} the actual value to be `false`. * @function @@ -6150,6 +6257,8 @@ getJasmineRequireObj().toBeFalse = function() { }; getJasmineRequireObj().toBeFalsy = function() { + 'use strict'; + /** * {@link expect} the actual value to be falsy * @function @@ -6172,6 +6281,8 @@ getJasmineRequireObj().toBeFalsy = function() { }; getJasmineRequireObj().toBeGreaterThan = function() { + 'use strict'; + /** * {@link expect} the actual value to be greater than the expected value. * @function @@ -6195,6 +6306,8 @@ getJasmineRequireObj().toBeGreaterThan = function() { }; getJasmineRequireObj().toBeGreaterThanOrEqual = function() { + 'use strict'; + /** * {@link expect} the actual value to be greater than or equal to the expected value. * @function @@ -6218,6 +6331,8 @@ getJasmineRequireObj().toBeGreaterThanOrEqual = function() { }; getJasmineRequireObj().toBeInstanceOf = function(j$) { + 'use strict'; + const usageError = j$.private.formatErrorMsg( '', 'expect(value).toBeInstanceOf()' @@ -6284,6 +6399,8 @@ getJasmineRequireObj().toBeInstanceOf = function(j$) { }; getJasmineRequireObj().toBeLessThan = function() { + 'use strict'; + /** * {@link expect} the actual value to be less than the expected value. * @function @@ -6307,6 +6424,8 @@ getJasmineRequireObj().toBeLessThan = function() { }; getJasmineRequireObj().toBeLessThanOrEqual = function() { + 'use strict'; + /** * {@link expect} the actual value to be less than or equal to the expected value. * @function @@ -6330,6 +6449,8 @@ getJasmineRequireObj().toBeLessThanOrEqual = function() { }; getJasmineRequireObj().toBeNaN = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `NaN` (Not a Number). * @function @@ -6362,6 +6483,8 @@ getJasmineRequireObj().toBeNaN = function(j$) { }; getJasmineRequireObj().toBeNegativeInfinity = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `-Infinity` (-infinity). * @function @@ -6394,6 +6517,8 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) { }; getJasmineRequireObj().toBeNull = function() { + 'use strict'; + /** * {@link expect} the actual value to be `null`. * @function @@ -6416,6 +6541,8 @@ getJasmineRequireObj().toBeNull = function() { }; getJasmineRequireObj().toBeNullish = function() { + 'use strict'; + /** * {@link expect} the actual value to be `null` or `undefined`. * @function @@ -6438,6 +6565,8 @@ getJasmineRequireObj().toBeNullish = function() { }; getJasmineRequireObj().toBePositiveInfinity = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `Infinity` (infinity). * @function @@ -6470,6 +6599,8 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) { }; getJasmineRequireObj().toBeTrue = function() { + 'use strict'; + /** * {@link expect} the actual value to be `true`. * @function @@ -6492,6 +6623,8 @@ getJasmineRequireObj().toBeTrue = function() { }; getJasmineRequireObj().toBeTruthy = function() { + 'use strict'; + /** * {@link expect} the actual value to be truthy. * @function @@ -6514,6 +6647,8 @@ getJasmineRequireObj().toBeTruthy = function() { }; getJasmineRequireObj().toBeUndefined = function() { + 'use strict'; + /** * {@link expect} the actual value to be `undefined`. * @function @@ -6536,6 +6671,8 @@ getJasmineRequireObj().toBeUndefined = function() { }; getJasmineRequireObj().toContain = function() { + 'use strict'; + /** * {@link expect} the actual value to contain a specific value. * @function @@ -6560,6 +6697,8 @@ getJasmineRequireObj().toContain = function() { }; getJasmineRequireObj().toEqual = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be equal to the expected, using deep equality comparison. * @function @@ -6593,6 +6732,8 @@ getJasmineRequireObj().toEqual = function(j$) { }; getJasmineRequireObj().toHaveBeenCalled = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalled()' @@ -6643,6 +6784,8 @@ getJasmineRequireObj().toHaveBeenCalled = function(j$) { }; getJasmineRequireObj().toHaveBeenCalledBefore = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledBefore()' @@ -6739,6 +6882,8 @@ getJasmineRequireObj().toHaveBeenCalledBefore = function(j$) { }; getJasmineRequireObj().toHaveBeenCalledOnceWith = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledOnceWith(...arguments)' @@ -6848,6 +6993,8 @@ getJasmineRequireObj().toHaveBeenCalledOnceWith = function(j$) { }; getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledTimes()' @@ -6924,6 +7071,8 @@ getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) { }; getJasmineRequireObj().toHaveBeenCalledWith = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledWith(...arguments)' @@ -7031,6 +7180,8 @@ getJasmineRequireObj().toHaveBeenCalledWith = function(j$) { }; getJasmineRequireObj().toHaveClass = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be a DOM element that has the expected class * @function @@ -7068,6 +7219,8 @@ getJasmineRequireObj().toHaveClass = function(j$) { }; getJasmineRequireObj().toHaveClasses = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be a DOM element that has the expected classes * @function @@ -7105,6 +7258,8 @@ getJasmineRequireObj().toHaveClasses = function(j$) { }; getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveNoOtherSpyInteractions()' @@ -7191,6 +7346,8 @@ getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { }; getJasmineRequireObj().toHaveSize = function(j$) { + 'use strict'; + /** * {@link expect} the actual size to be equal to the expected, using array-like length or object keys size. * @function @@ -7260,6 +7417,8 @@ getJasmineRequireObj().toHaveSize = function(j$) { }; getJasmineRequireObj().toHaveSpyInteractions = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveSpyInteractions()' @@ -7339,6 +7498,8 @@ getJasmineRequireObj().toHaveSpyInteractions = function(j$) { }; getJasmineRequireObj().toMatch = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toMatch( || )' @@ -7377,6 +7538,8 @@ getJasmineRequireObj().toMatch = function(j$) { }; getJasmineRequireObj().toThrow = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect(function() {}).toThrow()' @@ -7458,6 +7621,8 @@ getJasmineRequireObj().toThrow = function(j$) { }; getJasmineRequireObj().toThrowError = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect(function() {}).toThrowError(, )' @@ -7660,6 +7825,8 @@ getJasmineRequireObj().toThrowError = function(j$) { }; getJasmineRequireObj().toThrowMatching = function(j$) { + 'use strict'; + const usageError = j$.private.formatErrorMsg( '', 'expect(function() {}).toThrowMatching()' @@ -7742,6 +7909,8 @@ getJasmineRequireObj().toThrowMatching = function(j$) { }; getJasmineRequireObj().MockDate = function(j$) { + 'use strict'; + function MockDate(global) { let currentTime = 0; @@ -7850,6 +8019,8 @@ getJasmineRequireObj().MockDate = function(j$) { }; getJasmineRequireObj().NeverSkipPolicy = function(j$) { + 'use strict'; + function NeverSkipPolicy(queueableFns) {} NeverSkipPolicy.prototype.skipTo = function(lastRanFnIx) { @@ -7959,6 +8130,8 @@ getJasmineRequireObj().ParallelReportDispatcher = function(j$) { }; getJasmineRequireObj().makePrettyPrinter = function(j$) { + 'use strict'; + class SinglePrettyPrintRun { constructor(customObjectFormatters, pp) { this.customObjectFormatters_ = customObjectFormatters; @@ -8331,6 +8504,8 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) { }; getJasmineRequireObj().QueueRunner = function(j$) { + 'use strict'; + let nextid = 1; function StopExecutionError() {} @@ -8715,6 +8890,8 @@ getJasmineRequireObj().ReportDispatcher = function(j$) { }; getJasmineRequireObj().reporterEvents = function(j$) { + 'use strict'; + /** * Used to tell Jasmine what optional or uncommonly implemented features * the reporter supports. If not specified, the defaults described in @@ -8812,6 +8989,8 @@ getJasmineRequireObj().reporterEvents = function(j$) { }; getJasmineRequireObj().interface = function(jasmine, env) { + 'use strict'; + const jasmineInterface = { /** * Callback passed to parts of the Jasmine base interface. @@ -9335,6 +9514,8 @@ getJasmineRequireObj().interface = function(jasmine, env) { }; getJasmineRequireObj().RunableResources = function(j$) { + 'use strict'; + class RunableResources { constructor(options) { this.byRunableId_ = {}; @@ -9493,6 +9674,8 @@ getJasmineRequireObj().RunableResources = function(j$) { }; getJasmineRequireObj().Runner = function(j$) { + 'use strict'; + class Runner { #topSuite; #getTotalSpecsDefined; @@ -9680,6 +9863,8 @@ getJasmineRequireObj().Runner = function(j$) { }; getJasmineRequireObj().SkipAfterBeforeAllErrorPolicy = function(j$) { + 'use strict'; + function SkipAfterBeforeAllErrorPolicy(queueableFns) { this.queueableFns_ = queueableFns; this.skipping_ = false; @@ -9719,6 +9904,8 @@ getJasmineRequireObj().SkipAfterBeforeAllErrorPolicy = function(j$) { }; getJasmineRequireObj().Spy = function(j$) { + 'use strict'; + const nextOrder = (function() { let order = 0; @@ -9933,6 +10120,8 @@ getJasmineRequireObj().Spy = function(j$) { }; getJasmineRequireObj().SpyFactory = function(j$) { + 'use strict'; + function SpyFactory( getCustomStrategies, getDefaultStrategyFn, @@ -10303,6 +10492,8 @@ getJasmineRequireObj().SpyRegistry = function(j$) { }; getJasmineRequireObj().SpyStrategy = function(j$) { + 'use strict'; + /** * @interface SpyStrategy */ @@ -10484,6 +10675,8 @@ getJasmineRequireObj().SpyStrategy = function(j$) { }; getJasmineRequireObj().StackTrace = function(j$) { + 'use strict'; + function StackTrace(error) { let lines = error.stack.split('\n'); @@ -10616,6 +10809,8 @@ getJasmineRequireObj().StackTrace = function(j$) { }; getJasmineRequireObj().Suite = function(j$) { + 'use strict'; + class Suite { #reportedParentSuiteId; #throwOnExpectationFailure; @@ -11002,6 +11197,8 @@ getJasmineRequireObj().Suite = function(j$) { }; getJasmineRequireObj().SuiteBuilder = function(j$) { + 'use strict'; + class SuiteBuilder { constructor(options) { this.env_ = options.env; @@ -11346,6 +11543,8 @@ getJasmineRequireObj().SuiteBuilder = function(j$) { }; getJasmineRequireObj().Timer = function() { + 'use strict'; + const defaultNow = (function(Date) { return function() { return new Date().getTime(); @@ -11390,6 +11589,8 @@ getJasmineRequireObj().Timer = function() { }; getJasmineRequireObj().TreeProcessor = function(j$) { + 'use strict'; + const defaultMin = Infinity; const defaultMax = 1 - Infinity; @@ -11597,6 +11798,8 @@ getJasmineRequireObj().TreeProcessor = function(j$) { }; getJasmineRequireObj().TreeRunner = function(j$) { + 'use strict'; + class TreeRunner { #executionTree; #setTimeout; @@ -11884,6 +12087,8 @@ getJasmineRequireObj().TreeRunner = function(j$) { }; getJasmineRequireObj().UserContext = function(j$) { + 'use strict'; + function UserContext() {} UserContext.fromExisting = function(oldContext) { diff --git a/src/boot/boot0.js b/src/boot/boot0.js index 976e623f..0bb9da86 100644 --- a/src/boot/boot0.js +++ b/src/boot/boot0.js @@ -1,3 +1,5 @@ +'use strict'; + /** This file starts the process of "booting" Jasmine. It initializes Jasmine, makes its globals available, and creates the env. This file should be loaded diff --git a/src/boot/boot1.js b/src/boot/boot1.js index 45547069..7f22a55d 100644 --- a/src/boot/boot1.js +++ b/src/boot/boot1.js @@ -1,3 +1,5 @@ +'use strict'; + /** This file finishes 'booting' Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's diff --git a/src/boot/jasmine-core.js b/src/boot/jasmine-core.js index 6d8878fc..1ceab28c 100644 --- a/src/boot/jasmine-core.js +++ b/src/boot/jasmine-core.js @@ -1,3 +1,5 @@ +'use strict'; + /** * Note: Only available on Node. * @module jasmine-core diff --git a/src/core/CallTracker.js b/src/core/CallTracker.js index 403eaef4..7eeee8ca 100644 --- a/src/core/CallTracker.js +++ b/src/core/CallTracker.js @@ -1,4 +1,6 @@ getJasmineRequireObj().CallTracker = function(j$) { + 'use strict'; + /** * @namespace Spy#calls * @since 2.0.0 diff --git a/src/core/ClearStack.js b/src/core/ClearStack.js index c2948cff..6968bddc 100644 --- a/src/core/ClearStack.js +++ b/src/core/ClearStack.js @@ -1,4 +1,6 @@ getJasmineRequireObj().clearStack = function(j$) { + 'use strict'; + const maxInlineCallCount = 10; function browserQueueMicrotaskImpl(global) { diff --git a/src/core/Clock.js b/src/core/Clock.js index 4956fcac..dd018113 100644 --- a/src/core/Clock.js +++ b/src/core/Clock.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Clock = function() { + 'use strict'; + /* global process */ const NODE_JS = typeof process !== 'undefined' && diff --git a/src/core/CompleteOnFirstErrorSkipPolicy.js b/src/core/CompleteOnFirstErrorSkipPolicy.js index 1dcc4019..0d1bd9d0 100644 --- a/src/core/CompleteOnFirstErrorSkipPolicy.js +++ b/src/core/CompleteOnFirstErrorSkipPolicy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().CompleteOnFirstErrorSkipPolicy = function(j$) { + 'use strict'; + function CompleteOnFirstErrorSkipPolicy(queueableFns) { this.queueableFns_ = queueableFns; this.erroredFnIx_ = null; diff --git a/src/core/Configuration.js b/src/core/Configuration.js index 1d3a509c..b2aceae5 100644 --- a/src/core/Configuration.js +++ b/src/core/Configuration.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Configuration = function(j$) { + 'use strict'; + /** * This represents the available options to configure Jasmine. * Options that are not provided will use their default values. diff --git a/src/core/CurrentRunableTracker.js b/src/core/CurrentRunableTracker.js index b93fda3b..a66e1f59 100644 --- a/src/core/CurrentRunableTracker.js +++ b/src/core/CurrentRunableTracker.js @@ -1,4 +1,6 @@ getJasmineRequireObj().CurrentRunableTracker = function() { + 'use strict'; + class CurrentRunableTracker { #currentSpec; #currentlyExecutingSuites; diff --git a/src/core/Deprecator.js b/src/core/Deprecator.js index e4bff4e9..7686c70e 100644 --- a/src/core/Deprecator.js +++ b/src/core/Deprecator.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Deprecator = function(j$) { + 'use strict'; + function Deprecator(topSuite) { this.topSuite_ = topSuite; this.verbose_ = false; diff --git a/src/core/Env.js b/src/core/Env.js index 3b189bf2..52eefbe7 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Env = function(j$) { + 'use strict'; + /** * @class Env * @since 2.0.0 diff --git a/src/core/ExceptionFormatter.js b/src/core/ExceptionFormatter.js index cedc76e3..12d73645 100644 --- a/src/core/ExceptionFormatter.js +++ b/src/core/ExceptionFormatter.js @@ -1,4 +1,6 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) { + 'use strict'; + const ignoredProperties = [ 'name', 'message', diff --git a/src/core/Expectation.js b/src/core/Expectation.js index 00360404..4703ec6d 100644 --- a/src/core/Expectation.js +++ b/src/core/Expectation.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Expectation = function(j$) { + 'use strict'; + /** * Matchers that come with Jasmine out of the box. * @namespace matchers diff --git a/src/core/ExpectationFilterChain.js b/src/core/ExpectationFilterChain.js index 490d7d99..95f0d4fd 100644 --- a/src/core/ExpectationFilterChain.js +++ b/src/core/ExpectationFilterChain.js @@ -1,4 +1,6 @@ getJasmineRequireObj().ExpectationFilterChain = function() { + 'use strict'; + function ExpectationFilterChain(maybeFilter, prev) { this.filter_ = maybeFilter; this.prev_ = prev; diff --git a/src/core/Expector.js b/src/core/Expector.js index a5ddeabf..f833e2a1 100644 --- a/src/core/Expector.js +++ b/src/core/Expector.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Expector = function(j$) { + 'use strict'; + function Expector(options) { this.matchersUtil = options.matchersUtil || { buildFailureMessage: function() {} diff --git a/src/core/GlobalErrors.js b/src/core/GlobalErrors.js index c489f72e..a10c9a2b 100644 --- a/src/core/GlobalErrors.js +++ b/src/core/GlobalErrors.js @@ -1,4 +1,6 @@ getJasmineRequireObj().GlobalErrors = function(j$) { + 'use strict'; + class GlobalErrors { #getConfig; #adapter; diff --git a/src/core/JsApiReporter.js b/src/core/JsApiReporter.js index 6ab524af..16c0d768 100644 --- a/src/core/JsApiReporter.js +++ b/src/core/JsApiReporter.js @@ -1,4 +1,6 @@ getJasmineRequireObj().JsApiReporter = function(j$) { + 'use strict'; + /** * @name jsApiReporter * @classdesc {@link Reporter} added by default in `boot.js` to record results for retrieval in javascript code. An instance is made available as `jsApiReporter` on the global object. diff --git a/src/core/MockDate.js b/src/core/MockDate.js index d73c8ba9..ba6e9ca8 100644 --- a/src/core/MockDate.js +++ b/src/core/MockDate.js @@ -1,4 +1,6 @@ getJasmineRequireObj().MockDate = function(j$) { + 'use strict'; + function MockDate(global) { let currentTime = 0; diff --git a/src/core/NeverSkipPolicy.js b/src/core/NeverSkipPolicy.js index 7d72cd50..8c76dff7 100644 --- a/src/core/NeverSkipPolicy.js +++ b/src/core/NeverSkipPolicy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().NeverSkipPolicy = function(j$) { + 'use strict'; + function NeverSkipPolicy(queueableFns) {} NeverSkipPolicy.prototype.skipTo = function(lastRanFnIx) { diff --git a/src/core/Order.js b/src/core/Order.js index 3b9c27b5..dd97c7bd 100644 --- a/src/core/Order.js +++ b/src/core/Order.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Order = function() { + 'use strict'; + function Order(options) { this.random = 'random' in options ? options.random : true; const seed = (this.seed = options.seed || generateSeed()); diff --git a/src/core/PrettyPrinter.js b/src/core/PrettyPrinter.js index 7ee38566..8c358680 100644 --- a/src/core/PrettyPrinter.js +++ b/src/core/PrettyPrinter.js @@ -1,4 +1,6 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) { + 'use strict'; + class SinglePrettyPrintRun { constructor(customObjectFormatters, pp) { this.customObjectFormatters_ = customObjectFormatters; diff --git a/src/core/QueueRunner.js b/src/core/QueueRunner.js index 5dff3ee7..366ef5a1 100644 --- a/src/core/QueueRunner.js +++ b/src/core/QueueRunner.js @@ -1,4 +1,6 @@ getJasmineRequireObj().QueueRunner = function(j$) { + 'use strict'; + let nextid = 1; function StopExecutionError() {} diff --git a/src/core/RunableResources.js b/src/core/RunableResources.js index ae1ce6a8..eb14a86b 100644 --- a/src/core/RunableResources.js +++ b/src/core/RunableResources.js @@ -1,4 +1,6 @@ getJasmineRequireObj().RunableResources = function(j$) { + 'use strict'; + class RunableResources { constructor(options) { this.byRunableId_ = {}; diff --git a/src/core/Runner.js b/src/core/Runner.js index c2d4914d..d8bf1ba1 100644 --- a/src/core/Runner.js +++ b/src/core/Runner.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Runner = function(j$) { + 'use strict'; + class Runner { #topSuite; #getTotalSpecsDefined; diff --git a/src/core/SkipAfterBeforeAllErrorPolicy.js b/src/core/SkipAfterBeforeAllErrorPolicy.js index 57d88127..c1b71a9d 100644 --- a/src/core/SkipAfterBeforeAllErrorPolicy.js +++ b/src/core/SkipAfterBeforeAllErrorPolicy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().SkipAfterBeforeAllErrorPolicy = function(j$) { + 'use strict'; + function SkipAfterBeforeAllErrorPolicy(queueableFns) { this.queueableFns_ = queueableFns; this.skipping_ = false; diff --git a/src/core/Spec.js b/src/core/Spec.js index 2a284aab..e69d53a7 100644 --- a/src/core/Spec.js +++ b/src/core/Spec.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Spec = function(j$) { + 'use strict'; + class Spec { #autoCleanClosures; #throwOnExpectationFailure; diff --git a/src/core/Spy.js b/src/core/Spy.js index 73d7c248..5e84d19b 100644 --- a/src/core/Spy.js +++ b/src/core/Spy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Spy = function(j$) { + 'use strict'; + const nextOrder = (function() { let order = 0; diff --git a/src/core/SpyFactory.js b/src/core/SpyFactory.js index 51f89400..26a768be 100644 --- a/src/core/SpyFactory.js +++ b/src/core/SpyFactory.js @@ -1,4 +1,6 @@ getJasmineRequireObj().SpyFactory = function(j$) { + 'use strict'; + function SpyFactory( getCustomStrategies, getDefaultStrategyFn, diff --git a/src/core/SpyStrategy.js b/src/core/SpyStrategy.js index b3f79bb5..483cfc51 100644 --- a/src/core/SpyStrategy.js +++ b/src/core/SpyStrategy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().SpyStrategy = function(j$) { + 'use strict'; + /** * @interface SpyStrategy */ diff --git a/src/core/StackTrace.js b/src/core/StackTrace.js index dfefca6a..18efd720 100644 --- a/src/core/StackTrace.js +++ b/src/core/StackTrace.js @@ -1,4 +1,6 @@ getJasmineRequireObj().StackTrace = function(j$) { + 'use strict'; + function StackTrace(error) { let lines = error.stack.split('\n'); diff --git a/src/core/Suite.js b/src/core/Suite.js index 1ca477d1..6314e12c 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Suite = function(j$) { + 'use strict'; + class Suite { #reportedParentSuiteId; #throwOnExpectationFailure; diff --git a/src/core/SuiteBuilder.js b/src/core/SuiteBuilder.js index d3738969..f809d841 100644 --- a/src/core/SuiteBuilder.js +++ b/src/core/SuiteBuilder.js @@ -1,4 +1,6 @@ getJasmineRequireObj().SuiteBuilder = function(j$) { + 'use strict'; + class SuiteBuilder { constructor(options) { this.env_ = options.env; diff --git a/src/core/Timer.js b/src/core/Timer.js index 098345b3..a65064ba 100644 --- a/src/core/Timer.js +++ b/src/core/Timer.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Timer = function() { + 'use strict'; + const defaultNow = (function(Date) { return function() { return new Date().getTime(); diff --git a/src/core/TreeProcessor.js b/src/core/TreeProcessor.js index 72f7bfec..aebdeafa 100644 --- a/src/core/TreeProcessor.js +++ b/src/core/TreeProcessor.js @@ -1,4 +1,6 @@ getJasmineRequireObj().TreeProcessor = function(j$) { + 'use strict'; + const defaultMin = Infinity; const defaultMax = 1 - Infinity; diff --git a/src/core/TreeRunner.js b/src/core/TreeRunner.js index 8710b9a5..d30ab517 100644 --- a/src/core/TreeRunner.js +++ b/src/core/TreeRunner.js @@ -1,4 +1,6 @@ getJasmineRequireObj().TreeRunner = function(j$) { + 'use strict'; + class TreeRunner { #executionTree; #setTimeout; diff --git a/src/core/UserContext.js b/src/core/UserContext.js index d9b60b0a..ae7978e8 100644 --- a/src/core/UserContext.js +++ b/src/core/UserContext.js @@ -1,4 +1,6 @@ getJasmineRequireObj().UserContext = function(j$) { + 'use strict'; + function UserContext() {} UserContext.fromExisting = function(oldContext) { diff --git a/src/core/asymmetric_equality/Any.js b/src/core/asymmetric_equality/Any.js index ee634e9e..62d4210f 100644 --- a/src/core/asymmetric_equality/Any.js +++ b/src/core/asymmetric_equality/Any.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Any = function(j$) { + 'use strict'; + function Any(expectedObject) { if (typeof expectedObject === 'undefined') { throw new TypeError( diff --git a/src/core/asymmetric_equality/Anything.js b/src/core/asymmetric_equality/Anything.js index b22189b5..caca5af6 100644 --- a/src/core/asymmetric_equality/Anything.js +++ b/src/core/asymmetric_equality/Anything.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Anything = function(j$) { + 'use strict'; + function Anything() {} Anything.prototype.asymmetricMatch = function(other) { diff --git a/src/core/asymmetric_equality/ArrayContaining.js b/src/core/asymmetric_equality/ArrayContaining.js index c22046ef..7560df19 100644 --- a/src/core/asymmetric_equality/ArrayContaining.js +++ b/src/core/asymmetric_equality/ArrayContaining.js @@ -1,4 +1,6 @@ getJasmineRequireObj().ArrayContaining = function(j$) { + 'use strict'; + function ArrayContaining(sample) { this.sample = sample; } diff --git a/src/core/asymmetric_equality/ArrayWithExactContents.js b/src/core/asymmetric_equality/ArrayWithExactContents.js index c49f92d3..2d5f5172 100644 --- a/src/core/asymmetric_equality/ArrayWithExactContents.js +++ b/src/core/asymmetric_equality/ArrayWithExactContents.js @@ -1,4 +1,6 @@ getJasmineRequireObj().ArrayWithExactContents = function(j$) { + 'use strict'; + function ArrayWithExactContents(sample) { this.sample = sample; } diff --git a/src/core/asymmetric_equality/Empty.js b/src/core/asymmetric_equality/Empty.js index 7bc3d52e..097238ad 100644 --- a/src/core/asymmetric_equality/Empty.js +++ b/src/core/asymmetric_equality/Empty.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Empty = function(j$) { + 'use strict'; + function Empty() {} Empty.prototype.asymmetricMatch = function(other) { diff --git a/src/core/asymmetric_equality/Falsy.js b/src/core/asymmetric_equality/Falsy.js index d1d3c8ff..5f28722e 100644 --- a/src/core/asymmetric_equality/Falsy.js +++ b/src/core/asymmetric_equality/Falsy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Falsy = function(j$) { + 'use strict'; + function Falsy() {} Falsy.prototype.asymmetricMatch = function(other) { diff --git a/src/core/asymmetric_equality/Is.js b/src/core/asymmetric_equality/Is.js index 0152967c..67150877 100644 --- a/src/core/asymmetric_equality/Is.js +++ b/src/core/asymmetric_equality/Is.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Is = function(j$) { + 'use strict'; + class Is { constructor(expected) { this.expected_ = expected; diff --git a/src/core/asymmetric_equality/MapContaining.js b/src/core/asymmetric_equality/MapContaining.js index 4afe50d6..e3a68131 100644 --- a/src/core/asymmetric_equality/MapContaining.js +++ b/src/core/asymmetric_equality/MapContaining.js @@ -1,4 +1,6 @@ getJasmineRequireObj().MapContaining = function(j$) { + 'use strict'; + function MapContaining(sample) { if (!j$.private.isMap(sample)) { throw new Error( diff --git a/src/core/asymmetric_equality/NotEmpty.js b/src/core/asymmetric_equality/NotEmpty.js index 4a13fe81..088a053f 100644 --- a/src/core/asymmetric_equality/NotEmpty.js +++ b/src/core/asymmetric_equality/NotEmpty.js @@ -1,4 +1,6 @@ getJasmineRequireObj().NotEmpty = function(j$) { + 'use strict'; + function NotEmpty() {} NotEmpty.prototype.asymmetricMatch = function(other) { diff --git a/src/core/asymmetric_equality/ObjectContaining.js b/src/core/asymmetric_equality/ObjectContaining.js index 77b48428..8b775050 100644 --- a/src/core/asymmetric_equality/ObjectContaining.js +++ b/src/core/asymmetric_equality/ObjectContaining.js @@ -1,4 +1,6 @@ getJasmineRequireObj().ObjectContaining = function(j$) { + 'use strict'; + function ObjectContaining(sample) { this.sample = sample; } diff --git a/src/core/asymmetric_equality/SetContaining.js b/src/core/asymmetric_equality/SetContaining.js index cf373fd9..a42215a1 100644 --- a/src/core/asymmetric_equality/SetContaining.js +++ b/src/core/asymmetric_equality/SetContaining.js @@ -1,4 +1,6 @@ getJasmineRequireObj().SetContaining = function(j$) { + 'use strict'; + function SetContaining(sample) { if (!j$.private.isSet(sample)) { throw new Error( diff --git a/src/core/asymmetric_equality/StringContaining.js b/src/core/asymmetric_equality/StringContaining.js index b0e899f2..98302048 100644 --- a/src/core/asymmetric_equality/StringContaining.js +++ b/src/core/asymmetric_equality/StringContaining.js @@ -1,4 +1,6 @@ getJasmineRequireObj().StringContaining = function(j$) { + 'use strict'; + function StringContaining(expected) { if (!j$.private.isString(expected)) { throw new Error('Expected is not a String'); diff --git a/src/core/asymmetric_equality/StringMatching.js b/src/core/asymmetric_equality/StringMatching.js index 89b627cd..44cebaf1 100644 --- a/src/core/asymmetric_equality/StringMatching.js +++ b/src/core/asymmetric_equality/StringMatching.js @@ -1,4 +1,6 @@ getJasmineRequireObj().StringMatching = function(j$) { + 'use strict'; + function StringMatching(expected) { if (!j$.private.isString(expected) && !j$.private.isA('RegExp', expected)) { throw new Error('Expected is not a String or a RegExp'); diff --git a/src/core/asymmetric_equality/Truthy.js b/src/core/asymmetric_equality/Truthy.js index 9e527164..5e17caa7 100644 --- a/src/core/asymmetric_equality/Truthy.js +++ b/src/core/asymmetric_equality/Truthy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().Truthy = function(j$) { + 'use strict'; + function Truthy() {} Truthy.prototype.asymmetricMatch = function(other) { diff --git a/src/core/base.js b/src/core/base.js index c5ac348d..0fbad676 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -1,4 +1,6 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { + 'use strict'; + /** * Maximum object depth the pretty printer will print to. * Set this to a lower value to speed up pretty printing if you have large objects. diff --git a/src/core/buildExpectationResult.js b/src/core/buildExpectationResult.js index 442a5b25..7a052878 100644 --- a/src/core/buildExpectationResult.js +++ b/src/core/buildExpectationResult.js @@ -1,5 +1,7 @@ //TODO: expectation result may make more sense as a presentation of an expectation. getJasmineRequireObj().buildExpectationResult = function(j$) { + 'use strict'; + function buildExpectationResult(options) { const exceptionFormatter = new j$.private.ExceptionFormatter(); diff --git a/src/core/errors.js b/src/core/errors.js index ba7a502d..57032108 100644 --- a/src/core/errors.js +++ b/src/core/errors.js @@ -1,4 +1,6 @@ getJasmineRequireObj().errors = function() { + 'use strict'; + function ExpectationFailed() {} ExpectationFailed.prototype = new Error(); diff --git a/src/core/formatErrorMsg.js b/src/core/formatErrorMsg.js index 8e7f1f03..5eeaa48f 100644 --- a/src/core/formatErrorMsg.js +++ b/src/core/formatErrorMsg.js @@ -1,4 +1,6 @@ getJasmineRequireObj().formatErrorMsg = function() { + 'use strict'; + function generateErrorMsg(domain, usage) { const usageDefinition = usage ? '\nUsage: ' + usage : ''; diff --git a/src/core/matchers/DiffBuilder.js b/src/core/matchers/DiffBuilder.js index 489f12c9..d06bf7e2 100644 --- a/src/core/matchers/DiffBuilder.js +++ b/src/core/matchers/DiffBuilder.js @@ -1,4 +1,6 @@ getJasmineRequireObj().DiffBuilder = function(j$) { + 'use strict'; + class DiffBuilder { constructor(config) { this.prettyPrinter_ = diff --git a/src/core/matchers/MismatchTree.js b/src/core/matchers/MismatchTree.js index 504fc600..5d4da678 100644 --- a/src/core/matchers/MismatchTree.js +++ b/src/core/matchers/MismatchTree.js @@ -1,4 +1,6 @@ getJasmineRequireObj().MismatchTree = function(j$) { + 'use strict'; + /* To be able to apply custom object formatters at all possible levels of an object graph, DiffBuilder needs to be able to know not just where the diff --git a/src/core/matchers/NullDiffBuilder.js b/src/core/matchers/NullDiffBuilder.js index cb6672e4..43d8362e 100644 --- a/src/core/matchers/NullDiffBuilder.js +++ b/src/core/matchers/NullDiffBuilder.js @@ -1,4 +1,6 @@ getJasmineRequireObj().NullDiffBuilder = function(j$) { + 'use strict'; + return function() { return { withPath: function(_, block) { diff --git a/src/core/matchers/ObjectPath.js b/src/core/matchers/ObjectPath.js index e87e17de..7493d79d 100644 --- a/src/core/matchers/ObjectPath.js +++ b/src/core/matchers/ObjectPath.js @@ -1,4 +1,6 @@ getJasmineRequireObj().ObjectPath = function(j$) { + 'use strict'; + class ObjectPath { constructor(components) { this.components = components || []; diff --git a/src/core/matchers/async/toBePending.js b/src/core/matchers/async/toBePending.js index bd5549f6..06ec4a8c 100644 --- a/src/core/matchers/async/toBePending.js +++ b/src/core/matchers/async/toBePending.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBePending = function(j$) { + 'use strict'; + /** * Expect a promise to be pending, i.e. the promise is neither resolved nor rejected. * @function diff --git a/src/core/matchers/async/toBeRejected.js b/src/core/matchers/async/toBeRejected.js index 57e6d71b..84f83b96 100644 --- a/src/core/matchers/async/toBeRejected.js +++ b/src/core/matchers/async/toBeRejected.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeRejected = function(j$) { + 'use strict'; + /** * Expect a promise to be rejected. * @function diff --git a/src/core/matchers/async/toBeRejectedWith.js b/src/core/matchers/async/toBeRejectedWith.js index d640c901..61cce961 100644 --- a/src/core/matchers/async/toBeRejectedWith.js +++ b/src/core/matchers/async/toBeRejectedWith.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeRejectedWith = function(j$) { + 'use strict'; + /** * Expect a promise to be rejected with a value equal to the expected, using deep equality comparison. * @function diff --git a/src/core/matchers/async/toBeRejectedWithError.js b/src/core/matchers/async/toBeRejectedWithError.js index 1ef90713..24bd5391 100644 --- a/src/core/matchers/async/toBeRejectedWithError.js +++ b/src/core/matchers/async/toBeRejectedWithError.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeRejectedWithError = function(j$) { + 'use strict'; + /** * Expect a promise to be rejected with a value matched to the expected * @function diff --git a/src/core/matchers/async/toBeResolved.js b/src/core/matchers/async/toBeResolved.js index 1bfb7476..c9ff0c04 100644 --- a/src/core/matchers/async/toBeResolved.js +++ b/src/core/matchers/async/toBeResolved.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeResolved = function(j$) { + 'use strict'; + /** * Expect a promise to be resolved. * @function diff --git a/src/core/matchers/async/toBeResolvedTo.js b/src/core/matchers/async/toBeResolvedTo.js index 21426b82..59e7a01f 100644 --- a/src/core/matchers/async/toBeResolvedTo.js +++ b/src/core/matchers/async/toBeResolvedTo.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeResolvedTo = function(j$) { + 'use strict'; + /** * Expect a promise to be resolved to a value equal to the expected, using deep equality comparison. * @function diff --git a/src/core/matchers/matchersUtil.js b/src/core/matchers/matchersUtil.js index d6054aa9..a3b97768 100644 --- a/src/core/matchers/matchersUtil.js +++ b/src/core/matchers/matchersUtil.js @@ -1,4 +1,6 @@ getJasmineRequireObj().MatchersUtil = function(j$) { + 'use strict'; + /** * @class MatchersUtil * @classdesc Utilities for use in implementing matchers.
diff --git a/src/core/matchers/nothing.js b/src/core/matchers/nothing.js index 687cec28..42e5f2d5 100644 --- a/src/core/matchers/nothing.js +++ b/src/core/matchers/nothing.js @@ -1,4 +1,6 @@ getJasmineRequireObj().nothing = function() { + 'use strict'; + /** * {@link expect} nothing explicitly. * @function diff --git a/src/core/matchers/requireAsyncMatchers.js b/src/core/matchers/requireAsyncMatchers.js index cb8cf5b2..b24717db 100644 --- a/src/core/matchers/requireAsyncMatchers.js +++ b/src/core/matchers/requireAsyncMatchers.js @@ -1,4 +1,6 @@ getJasmineRequireObj().requireAsyncMatchers = function(jRequire, j$) { + 'use strict'; + const availableMatchers = [ 'toBePending', 'toBeResolved', diff --git a/src/core/matchers/requireMatchers.js b/src/core/matchers/requireMatchers.js index 5eb64617..d0567a1e 100755 --- a/src/core/matchers/requireMatchers.js +++ b/src/core/matchers/requireMatchers.js @@ -1,4 +1,6 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) { + 'use strict'; + const availableMatchers = [ 'nothing', 'toBe', diff --git a/src/core/matchers/toBe.js b/src/core/matchers/toBe.js index 8b795380..bd997ff1 100644 --- a/src/core/matchers/toBe.js +++ b/src/core/matchers/toBe.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBe = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `===` to the expected value. * @function diff --git a/src/core/matchers/toBeCloseTo.js b/src/core/matchers/toBeCloseTo.js index edab5522..c5a66ab0 100644 --- a/src/core/matchers/toBeCloseTo.js +++ b/src/core/matchers/toBeCloseTo.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeCloseTo = function() { + 'use strict'; + /** * {@link expect} the actual value to be within a specified precision of the expected value. * @function diff --git a/src/core/matchers/toBeDefined.js b/src/core/matchers/toBeDefined.js index 0c43f7d2..f8274096 100644 --- a/src/core/matchers/toBeDefined.js +++ b/src/core/matchers/toBeDefined.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeDefined = function() { + 'use strict'; + /** * {@link expect} the actual value to be defined. (Not `undefined`) * @function diff --git a/src/core/matchers/toBeFalse.js b/src/core/matchers/toBeFalse.js index e26fb834..5c14535e 100644 --- a/src/core/matchers/toBeFalse.js +++ b/src/core/matchers/toBeFalse.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeFalse = function() { + 'use strict'; + /** * {@link expect} the actual value to be `false`. * @function diff --git a/src/core/matchers/toBeFalsy.js b/src/core/matchers/toBeFalsy.js index db61d465..a5527b5c 100644 --- a/src/core/matchers/toBeFalsy.js +++ b/src/core/matchers/toBeFalsy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeFalsy = function() { + 'use strict'; + /** * {@link expect} the actual value to be falsy * @function diff --git a/src/core/matchers/toBeGreaterThan.js b/src/core/matchers/toBeGreaterThan.js index 07dad333..fb06f325 100644 --- a/src/core/matchers/toBeGreaterThan.js +++ b/src/core/matchers/toBeGreaterThan.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeGreaterThan = function() { + 'use strict'; + /** * {@link expect} the actual value to be greater than the expected value. * @function diff --git a/src/core/matchers/toBeGreaterThanOrEqual.js b/src/core/matchers/toBeGreaterThanOrEqual.js index 1f33b5e6..27de49cc 100644 --- a/src/core/matchers/toBeGreaterThanOrEqual.js +++ b/src/core/matchers/toBeGreaterThanOrEqual.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeGreaterThanOrEqual = function() { + 'use strict'; + /** * {@link expect} the actual value to be greater than or equal to the expected value. * @function diff --git a/src/core/matchers/toBeInstanceOf.js b/src/core/matchers/toBeInstanceOf.js index a58cb32c..d759bca9 100644 --- a/src/core/matchers/toBeInstanceOf.js +++ b/src/core/matchers/toBeInstanceOf.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeInstanceOf = function(j$) { + 'use strict'; + const usageError = j$.private.formatErrorMsg( '', 'expect(value).toBeInstanceOf()' diff --git a/src/core/matchers/toBeLessThan.js b/src/core/matchers/toBeLessThan.js index 162e52f1..a65eba82 100644 --- a/src/core/matchers/toBeLessThan.js +++ b/src/core/matchers/toBeLessThan.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeLessThan = function() { + 'use strict'; + /** * {@link expect} the actual value to be less than the expected value. * @function diff --git a/src/core/matchers/toBeLessThanOrEqual.js b/src/core/matchers/toBeLessThanOrEqual.js index f2d47b69..67db8696 100644 --- a/src/core/matchers/toBeLessThanOrEqual.js +++ b/src/core/matchers/toBeLessThanOrEqual.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeLessThanOrEqual = function() { + 'use strict'; + /** * {@link expect} the actual value to be less than or equal to the expected value. * @function diff --git a/src/core/matchers/toBeNaN.js b/src/core/matchers/toBeNaN.js index b17a5b5e..6140b50e 100644 --- a/src/core/matchers/toBeNaN.js +++ b/src/core/matchers/toBeNaN.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeNaN = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `NaN` (Not a Number). * @function diff --git a/src/core/matchers/toBeNegativeInfinity.js b/src/core/matchers/toBeNegativeInfinity.js index 36caee9a..ca306812 100644 --- a/src/core/matchers/toBeNegativeInfinity.js +++ b/src/core/matchers/toBeNegativeInfinity.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `-Infinity` (-infinity). * @function diff --git a/src/core/matchers/toBeNull.js b/src/core/matchers/toBeNull.js index 36b06133..5fecf6d9 100644 --- a/src/core/matchers/toBeNull.js +++ b/src/core/matchers/toBeNull.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeNull = function() { + 'use strict'; + /** * {@link expect} the actual value to be `null`. * @function diff --git a/src/core/matchers/toBeNullish.js b/src/core/matchers/toBeNullish.js index c833d43f..d249286d 100644 --- a/src/core/matchers/toBeNullish.js +++ b/src/core/matchers/toBeNullish.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeNullish = function() { + 'use strict'; + /** * {@link expect} the actual value to be `null` or `undefined`. * @function diff --git a/src/core/matchers/toBePositiveInfinity.js b/src/core/matchers/toBePositiveInfinity.js index d4541a37..4bb1988e 100644 --- a/src/core/matchers/toBePositiveInfinity.js +++ b/src/core/matchers/toBePositiveInfinity.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be `Infinity` (infinity). * @function diff --git a/src/core/matchers/toBeTrue.js b/src/core/matchers/toBeTrue.js index 63331093..06b6313d 100644 --- a/src/core/matchers/toBeTrue.js +++ b/src/core/matchers/toBeTrue.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeTrue = function() { + 'use strict'; + /** * {@link expect} the actual value to be `true`. * @function diff --git a/src/core/matchers/toBeTruthy.js b/src/core/matchers/toBeTruthy.js index 3bece851..73e08489 100644 --- a/src/core/matchers/toBeTruthy.js +++ b/src/core/matchers/toBeTruthy.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeTruthy = function() { + 'use strict'; + /** * {@link expect} the actual value to be truthy. * @function diff --git a/src/core/matchers/toBeUndefined.js b/src/core/matchers/toBeUndefined.js index 04469364..3eed58a4 100644 --- a/src/core/matchers/toBeUndefined.js +++ b/src/core/matchers/toBeUndefined.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toBeUndefined = function() { + 'use strict'; + /** * {@link expect} the actual value to be `undefined`. * @function diff --git a/src/core/matchers/toContain.js b/src/core/matchers/toContain.js index 9ab30154..36c60e6c 100644 --- a/src/core/matchers/toContain.js +++ b/src/core/matchers/toContain.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toContain = function() { + 'use strict'; + /** * {@link expect} the actual value to contain a specific value. * @function diff --git a/src/core/matchers/toEqual.js b/src/core/matchers/toEqual.js index 688c1dd1..9a8ad1c0 100644 --- a/src/core/matchers/toEqual.js +++ b/src/core/matchers/toEqual.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toEqual = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be equal to the expected, using deep equality comparison. * @function diff --git a/src/core/matchers/toHaveBeenCalled.js b/src/core/matchers/toHaveBeenCalled.js index 4e836d4a..6da4c407 100644 --- a/src/core/matchers/toHaveBeenCalled.js +++ b/src/core/matchers/toHaveBeenCalled.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveBeenCalled = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalled()' diff --git a/src/core/matchers/toHaveBeenCalledBefore.js b/src/core/matchers/toHaveBeenCalledBefore.js index fb0b1496..8f95fc74 100644 --- a/src/core/matchers/toHaveBeenCalledBefore.js +++ b/src/core/matchers/toHaveBeenCalledBefore.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveBeenCalledBefore = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledBefore()' diff --git a/src/core/matchers/toHaveBeenCalledOnceWith.js b/src/core/matchers/toHaveBeenCalledOnceWith.js index 91d8924c..1b241ab0 100644 --- a/src/core/matchers/toHaveBeenCalledOnceWith.js +++ b/src/core/matchers/toHaveBeenCalledOnceWith.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveBeenCalledOnceWith = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledOnceWith(...arguments)' diff --git a/src/core/matchers/toHaveBeenCalledTimes.js b/src/core/matchers/toHaveBeenCalledTimes.js index 2bb8b02f..68023ac0 100644 --- a/src/core/matchers/toHaveBeenCalledTimes.js +++ b/src/core/matchers/toHaveBeenCalledTimes.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveBeenCalledTimes = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledTimes()' diff --git a/src/core/matchers/toHaveBeenCalledWith.js b/src/core/matchers/toHaveBeenCalledWith.js index 666b504a..ebdc8492 100644 --- a/src/core/matchers/toHaveBeenCalledWith.js +++ b/src/core/matchers/toHaveBeenCalledWith.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveBeenCalledWith = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveBeenCalledWith(...arguments)' diff --git a/src/core/matchers/toHaveClass.js b/src/core/matchers/toHaveClass.js index 7d497868..63591a6e 100644 --- a/src/core/matchers/toHaveClass.js +++ b/src/core/matchers/toHaveClass.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveClass = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be a DOM element that has the expected class * @function diff --git a/src/core/matchers/toHaveClasses.js b/src/core/matchers/toHaveClasses.js index 39a840d0..145ec29d 100644 --- a/src/core/matchers/toHaveClasses.js +++ b/src/core/matchers/toHaveClasses.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveClasses = function(j$) { + 'use strict'; + /** * {@link expect} the actual value to be a DOM element that has the expected classes * @function diff --git a/src/core/matchers/toHaveNoOtherSpyInteractions.js b/src/core/matchers/toHaveNoOtherSpyInteractions.js index 1457476c..a358828a 100644 --- a/src/core/matchers/toHaveNoOtherSpyInteractions.js +++ b/src/core/matchers/toHaveNoOtherSpyInteractions.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveNoOtherSpyInteractions()' diff --git a/src/core/matchers/toHaveSize.js b/src/core/matchers/toHaveSize.js index d215d703..d393a2e4 100644 --- a/src/core/matchers/toHaveSize.js +++ b/src/core/matchers/toHaveSize.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveSize = function(j$) { + 'use strict'; + /** * {@link expect} the actual size to be equal to the expected, using array-like length or object keys size. * @function diff --git a/src/core/matchers/toHaveSpyInteractions.js b/src/core/matchers/toHaveSpyInteractions.js index b71baff5..9851200d 100755 --- a/src/core/matchers/toHaveSpyInteractions.js +++ b/src/core/matchers/toHaveSpyInteractions.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toHaveSpyInteractions = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toHaveSpyInteractions()' diff --git a/src/core/matchers/toMatch.js b/src/core/matchers/toMatch.js index 1475d930..dd07f713 100644 --- a/src/core/matchers/toMatch.js +++ b/src/core/matchers/toMatch.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toMatch = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect().toMatch( || )' diff --git a/src/core/matchers/toThrow.js b/src/core/matchers/toThrow.js index db230097..00c6415c 100644 --- a/src/core/matchers/toThrow.js +++ b/src/core/matchers/toThrow.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toThrow = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect(function() {}).toThrow()' diff --git a/src/core/matchers/toThrowError.js b/src/core/matchers/toThrowError.js index 46554220..7fb729b6 100644 --- a/src/core/matchers/toThrowError.js +++ b/src/core/matchers/toThrowError.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toThrowError = function(j$) { + 'use strict'; + const getErrorMsg = j$.private.formatErrorMsg( '', 'expect(function() {}).toThrowError(, )' diff --git a/src/core/matchers/toThrowMatching.js b/src/core/matchers/toThrowMatching.js index 508fa226..d684ab36 100644 --- a/src/core/matchers/toThrowMatching.js +++ b/src/core/matchers/toThrowMatching.js @@ -1,4 +1,6 @@ getJasmineRequireObj().toThrowMatching = function(j$) { + 'use strict'; + const usageError = j$.private.formatErrorMsg( '', 'expect(function() {}).toThrowMatching()' diff --git a/src/core/reporterEvents.js b/src/core/reporterEvents.js index e215c324..633b1c4f 100644 --- a/src/core/reporterEvents.js +++ b/src/core/reporterEvents.js @@ -1,4 +1,6 @@ getJasmineRequireObj().reporterEvents = function(j$) { + 'use strict'; + /** * Used to tell Jasmine what optional or uncommonly implemented features * the reporter supports. If not specified, the defaults described in diff --git a/src/core/requireCore.js b/src/core/requireCore.js index 63925f61..3eb5f03f 100644 --- a/src/core/requireCore.js +++ b/src/core/requireCore.js @@ -1,5 +1,6 @@ // eslint-disable-next-line no-unused-vars,no-var var getJasmineRequireObj = (function(jasmineGlobal) { + 'use strict'; let jasmineRequire; if ( diff --git a/src/core/requireInterface.js b/src/core/requireInterface.js index 45f0f721..bcdb7fe0 100644 --- a/src/core/requireInterface.js +++ b/src/core/requireInterface.js @@ -1,4 +1,6 @@ getJasmineRequireObj().interface = function(jasmine, env) { + 'use strict'; + const jasmineInterface = { /** * Callback passed to parts of the Jasmine base interface. diff --git a/src/core/util.js b/src/core/util.js index 52ef4a74..a39defae 100644 --- a/src/core/util.js +++ b/src/core/util.js @@ -1,4 +1,6 @@ getJasmineRequireObj().util = function(j$) { + 'use strict'; + const util = {}; util.clone = function(obj) { diff --git a/src/html/HtmlExactSpecFilter.js b/src/html/HtmlExactSpecFilter.js index a027648c..6a18d83a 100644 --- a/src/html/HtmlExactSpecFilter.js +++ b/src/html/HtmlExactSpecFilter.js @@ -1,4 +1,6 @@ jasmineRequire.HtmlExactSpecFilter = function() { + 'use strict'; + /** * Spec filter for use with {@link HtmlReporter} * diff --git a/src/html/HtmlReporter.js b/src/html/HtmlReporter.js index 33a2f165..b063fa5d 100644 --- a/src/html/HtmlReporter.js +++ b/src/html/HtmlReporter.js @@ -1,4 +1,6 @@ jasmineRequire.HtmlReporter = function(j$) { + 'use strict'; + function ResultsStateBuilder() { this.topResults = new j$.private.ResultsNode({}, '', null); this.currentParent = this.topResults; diff --git a/src/html/HtmlSpecFilter.js b/src/html/HtmlSpecFilter.js index 187b20f2..9217eee9 100644 --- a/src/html/HtmlSpecFilter.js +++ b/src/html/HtmlSpecFilter.js @@ -1,4 +1,6 @@ jasmineRequire.HtmlSpecFilter = function() { + 'use strict'; + /** * @name HtmlSpecFilter * @classdesc Legacy HTML spec filter, for backward compatibility diff --git a/src/html/QueryString.js b/src/html/QueryString.js index f82a4dd0..9e380f54 100644 --- a/src/html/QueryString.js +++ b/src/html/QueryString.js @@ -1,4 +1,6 @@ jasmineRequire.QueryString = function() { + 'use strict'; + /** * Reads and manipulates the query string. * @since 2.0.0 diff --git a/src/html/ResultsNode.js b/src/html/ResultsNode.js index bc3e0b4c..d9331a40 100644 --- a/src/html/ResultsNode.js +++ b/src/html/ResultsNode.js @@ -1,4 +1,6 @@ jasmineRequire.ResultsNode = function() { + 'use strict'; + function ResultsNode(result, type, parent) { this.result = result; this.type = type;