mirror of
https://github.com/google/blockly.git
synced 2026-02-13 19:10:10 +01:00
614 lines
13 KiB
Plaintext
614 lines
13 KiB
Plaintext
/*!
|
|
|
|
diff v4.0.1
|
|
|
|
Software License Agreement (BSD License)
|
|
|
|
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
|
|
|
All rights reserved.
|
|
|
|
Redistribution and use of this software in source and binary forms, with or without modification,
|
|
are permitted provided that the following conditions are met:
|
|
|
|
* Redistributions of source code must retain the above
|
|
copyright notice, this list of conditions and the
|
|
following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
copyright notice, this list of conditions and the
|
|
following disclaimer in the documentation and/or other
|
|
materials provided with the distribution.
|
|
|
|
* Neither the name of Kevin Decker nor the names of its
|
|
contributors may be used to endorse or promote products
|
|
derived from this software without specific prior
|
|
written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@license
|
|
*/
|
|
|
|
/*!
|
|
* ### ._obj
|
|
*
|
|
* Quick reference to stored `actual` value for plugin developers.
|
|
*
|
|
* @api private
|
|
*/
|
|
|
|
/*!
|
|
* ### .ifError(object)
|
|
*
|
|
* Asserts if value is not a false value, and throws if it is a true value.
|
|
* This is added to allow for chai to be a drop-in replacement for Node's
|
|
* assert class.
|
|
*
|
|
* var err = new Error('I am a custom error');
|
|
* assert.ifError(err); // Rethrows err!
|
|
*
|
|
* @name ifError
|
|
* @param {Object} object
|
|
* @namespace Assert
|
|
* @api public
|
|
*/
|
|
|
|
/*!
|
|
* Aliases.
|
|
*/
|
|
|
|
/*!
|
|
* Assertion Constructor
|
|
*
|
|
* Creates object for chaining.
|
|
*
|
|
* `Assertion` objects contain metadata in the form of flags. Three flags can
|
|
* be assigned during instantiation by passing arguments to this constructor:
|
|
*
|
|
* - `object`: This flag contains the target of the assertion. For example, in
|
|
* the assertion `expect(numKittens).to.equal(7);`, the `object` flag will
|
|
* contain `numKittens` so that the `equal` assertion can reference it when
|
|
* needed.
|
|
*
|
|
* - `message`: This flag contains an optional custom error message to be
|
|
* prepended to the error message that's generated by the assertion when it
|
|
* fails.
|
|
*
|
|
* - `ssfi`: This flag stands for "start stack function indicator". It
|
|
* contains a function reference that serves as the starting point for
|
|
* removing frames from the stack trace of the error that's created by the
|
|
* assertion when it fails. The goal is to provide a cleaner stack trace to
|
|
* end users by removing Chai's internal functions. Note that it only works
|
|
* in environments that support `Error.captureStackTrace`, and only when
|
|
* `Chai.config.includeStack` hasn't been set to `false`.
|
|
*
|
|
* - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
|
|
* should retain its current value, even as assertions are chained off of
|
|
* this object. This is usually set to `true` when creating a new assertion
|
|
* from within another assertion. It's also temporarily set to `true` before
|
|
* an overwritten assertion gets called by the overwriting assertion.
|
|
*
|
|
* - `eql`: This flag contains the deepEqual function to be used by the assertion.
|
|
*
|
|
* @param {Mixed} obj target of the assertion
|
|
* @param {String} msg (optional) custom error message
|
|
* @param {Function} ssfi (optional) starting point for removing stack frames
|
|
* @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked
|
|
* @api private
|
|
*/
|
|
|
|
/*!
|
|
* Chai dependencies.
|
|
*/
|
|
|
|
/*!
|
|
* Module dependencies.
|
|
*/
|
|
|
|
/*!
|
|
* Module export.
|
|
*/
|
|
|
|
/*!
|
|
* Add a chainable method
|
|
*/
|
|
|
|
/*!
|
|
* Assert interface
|
|
*/
|
|
|
|
/*!
|
|
* Assertion Error
|
|
*/
|
|
|
|
/*!
|
|
* Chai - addChainingMethod utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - addLengthGuard utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - addMethod utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - addProperty utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - compareByInspect utility
|
|
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - expectTypes utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - flag utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - getActual utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - getOwnEnumerableProperties utility
|
|
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - getOwnEnumerablePropertySymbols utility
|
|
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - getProperties utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - isNaN utility
|
|
* Copyright(c) 2012-2015 Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - isProxyEnabled helper
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - message composition utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - overwriteChainableMethod utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - overwriteMethod utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - overwriteProperty utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - test utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai - transferFlags utility
|
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* Chai version
|
|
*/
|
|
|
|
/*!
|
|
* Check if a property exists
|
|
*/
|
|
|
|
/*!
|
|
* Check to see if the MemoizeMap has recorded a result of the two operands
|
|
*
|
|
* @param {Mixed} leftHandOperand
|
|
* @param {Mixed} rightHandOperand
|
|
* @param {MemoizeMap} memoizeMap
|
|
* @returns {Boolean|null} result
|
|
*/
|
|
|
|
/*!
|
|
* Checks error against a given set of criteria
|
|
*/
|
|
|
|
/*!
|
|
* Compare by inspect method
|
|
*/
|
|
|
|
/*!
|
|
* Compare two Regular Expressions for equality.
|
|
*
|
|
* @param {RegExp} leftHandOperand
|
|
* @param {RegExp} rightHandOperand
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Compare two Sets/Maps for equality. Faster than other equality functions.
|
|
*
|
|
* @param {Set} leftHandOperand
|
|
* @param {Set} rightHandOperand
|
|
* @param {Object} [options] (Optional)
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Configuration
|
|
*/
|
|
|
|
/*!
|
|
* Core Assertions
|
|
*/
|
|
|
|
/*!
|
|
* Deep equal utility
|
|
*/
|
|
|
|
/*!
|
|
* Deep path info
|
|
*/
|
|
|
|
/*!
|
|
* Dependencies that are used for multiple exports are required here only once
|
|
*/
|
|
|
|
/*!
|
|
* Determine if the given object has an @@iterator function.
|
|
*
|
|
* @param {Object} target
|
|
* @return {Boolean} `true` if the object has an @@iterator function.
|
|
*/
|
|
|
|
/*!
|
|
* Determines if two objects have matching values, given a set of keys. Defers to deepEqual for the equality check of
|
|
* each key. If any value of the given key is not equal, the function will return false (early).
|
|
*
|
|
* @param {Mixed} leftHandOperand
|
|
* @param {Mixed} rightHandOperand
|
|
* @param {Array} keys An array of keys to compare the values of leftHandOperand and rightHandOperand against
|
|
* @param {Object} [options] (Optional)
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Ensure correct constructor
|
|
*/
|
|
|
|
/*!
|
|
* Expect interface
|
|
*/
|
|
|
|
/*!
|
|
* Flag transferring utility
|
|
*/
|
|
|
|
/*!
|
|
* Flag utility
|
|
*/
|
|
|
|
/*!
|
|
* Function name
|
|
*/
|
|
|
|
/*!
|
|
* Get own enumerable properties method
|
|
*/
|
|
|
|
/*!
|
|
* Get own enumerable property symbols method
|
|
*/
|
|
|
|
/*!
|
|
* Gets all entries from a Generator. This will consume the generator - which could have side effects.
|
|
*
|
|
* @param {Generator} target
|
|
* @returns {Array} an array of entries from the Generator.
|
|
*/
|
|
|
|
/*!
|
|
* Gets all iterator entries from the given Object. If the Object has no @@iterator function, returns an empty array.
|
|
* This will consume the iterator - which could have side effects depending on the @@iterator implementation.
|
|
*
|
|
* @param {Object} target
|
|
* @returns {Array} an array of entries from the @@iterator function
|
|
*/
|
|
|
|
/*!
|
|
* Gets all own and inherited enumerable keys from a target.
|
|
*
|
|
* @param {Object} target
|
|
* @returns {Array} an array of own and inherited enumerable keys from the target.
|
|
*/
|
|
|
|
/*!
|
|
* Inherit from Error.prototype
|
|
*/
|
|
|
|
/*!
|
|
* Inspect util
|
|
*/
|
|
|
|
/*!
|
|
* Module dependencies
|
|
*/
|
|
|
|
/*!
|
|
* Object Display util
|
|
*/
|
|
|
|
/*!
|
|
* Overwrite chainable method
|
|
*/
|
|
|
|
/*!
|
|
* Primary Export
|
|
*/
|
|
|
|
/*!
|
|
* Primary Exports
|
|
*/
|
|
|
|
/*!
|
|
* Primary `Assertion` prototype
|
|
*/
|
|
|
|
/*!
|
|
* Proxify util
|
|
*/
|
|
|
|
/*!
|
|
* Recursively check the equality of two Objects. Once basic sameness has been established it will defer to `deepEqual`
|
|
* for each enumerable key in the object.
|
|
*
|
|
* @param {Mixed} leftHandOperand
|
|
* @param {Mixed} rightHandOperand
|
|
* @param {Object} [options] (Optional)
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Return a function that will copy properties from
|
|
* one object to another excluding any originally
|
|
* listed. Returned function will create a new `{}`.
|
|
*
|
|
* @param {String} excluded properties ...
|
|
* @return {Function}
|
|
*/
|
|
|
|
/*!
|
|
* Returns true if the argument is a primitive.
|
|
*
|
|
* This intentionally returns true for all objects that can be compared by reference,
|
|
* including functions and symbols.
|
|
*
|
|
* @param {Mixed} value
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Set the result of the equality into the MemoizeMap
|
|
*
|
|
* @param {Mixed} leftHandOperand
|
|
* @param {Mixed} rightHandOperand
|
|
* @param {MemoizeMap} memoizeMap
|
|
* @param {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Should interface
|
|
*/
|
|
|
|
/*!
|
|
* Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers.
|
|
*
|
|
* @param {Iterable} leftHandOperand
|
|
* @param {Iterable} rightHandOperand
|
|
* @param {Object} [options] (Optional)
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Simple equality for generator objects such as those returned by generator functions.
|
|
*
|
|
* @param {Iterable} leftHandOperand
|
|
* @param {Iterable} rightHandOperand
|
|
* @param {Object} [options] (Optional)
|
|
* @return {Boolean} result
|
|
*/
|
|
|
|
/*!
|
|
* Statically set name
|
|
*/
|
|
|
|
/*!
|
|
* The main logic of the `deepEqual` function.
|
|
*
|
|
* @param {Mixed} leftHandOperand
|
|
* @param {Mixed} rightHandOperand
|
|
* @param {Object} [options] (optional) Additional options
|
|
* @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality.
|
|
* @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of
|
|
complex objects for a speed boost. By passing `false` you can disable memoization, but this will cause circular
|
|
references to blow the stack.
|
|
* @return {Boolean} equal match
|
|
*/
|
|
|
|
/*!
|
|
* Utility Functions
|
|
*/
|
|
|
|
/*!
|
|
* Utils for plugins (not exported)
|
|
*/
|
|
|
|
/*!
|
|
* actual utility
|
|
*/
|
|
|
|
/*!
|
|
* add Method
|
|
*/
|
|
|
|
/*!
|
|
* add Property
|
|
*/
|
|
|
|
/*!
|
|
* addLengthGuard util
|
|
*/
|
|
|
|
/*!
|
|
* assertion-error
|
|
* Copyright(c) 2013 Jake Luer <jake@qualiancy.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* chai
|
|
* Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* chai
|
|
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* chai
|
|
* http://chaijs.com
|
|
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* deep-eql
|
|
* Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
|
|
* MIT Licensed
|
|
*/
|
|
|
|
/*!
|
|
* expectTypes utility
|
|
*/
|
|
|
|
/*!
|
|
* getOperator method
|
|
*/
|
|
|
|
/*!
|
|
* isNaN method
|
|
*/
|
|
|
|
/*!
|
|
* isProxyEnabled helper
|
|
*/
|
|
|
|
/*!
|
|
* message utility
|
|
*/
|
|
|
|
/*!
|
|
* overwrite Method
|
|
*/
|
|
|
|
/*!
|
|
* overwrite Property
|
|
*/
|
|
|
|
/*!
|
|
* test utility
|
|
*/
|
|
|
|
/*!
|
|
* type utility
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright 2021 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright 2023 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @license
|
|
* Copyright 2024 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|