Release notes

1.2.3

Bug fixes

  • Fixed a compiler warning.

1.2.2

Bug fixes

  • Fixed a compiler warning.

1.2.1

Bug fixes

  • Fixed links in the mocha html report not working if the component database was not named js.component.4dbase.

1.2.0

New features

  • _.valueForKeyPath() has been enhanced in several ways. See the documentation for details.

  • Added DateTimeStatic.formatUTCOffset() as a corollary to DateTime.formatUTCOffset(). See the documentation for details.

  • You can now pass "*" to DateTime.now() to get the current date and time from Server.

  • Added DateTime.offset() to create a new DateTime whose UTC offset is the given number of seconds. See the documentation for details.

  • You can now pass a number to ChaiBdd.throw() to test if the thrown error has the specified error code.

  • A negative count is considered "replace all" in _.regexReplace() and Regex.replace().

  • A negative limit is considered no limit in _.regexSplit() and Regex.split().

  • If there is a an error in the code of a unit test assertion, the error type, message, and offending line of code is displayed in the html report.

  • If test suites and/or tests have been skipped explicitly via .skip() or implicitly via .only(), the html report header shows the count of selected tests that were skipped.

API changes

  • All of the regex functions (both Regex and _.regex*) now take an optional last parameter, throwOnBadPattern, which defaults to false. If true and the pattern is malformed, in addition to returning a failure value, a SyntaxError is thrown. See the documentation for details.

  • _.parseJSON() now returns a SyntaxError instance if the input is malformed. See the documentation for details.

  • _.stringify() now throws a TypeError if given a type that JSON Stringify cannot stringify (such as a picture).

  • _.exec() always throws a SystemError.

Bug fixes

  • Fixed the name of the .setCustomLinkModifiers method in the documentation.

  • Fixed _.resolveMethodRef() to work correctly with methods.

  • Fixed test links not working in mocha reports.

  • Hopefully fixed an issue with a "Too many files open" error in the timezone refresh process.

1.1.0

New features

  • Added support for constructing a DateTime from a number of milliseconds since the Unix epoch (positive or negative).

  • Added DateTime.epochTime to get the number of milliseconds since the Unix epoch.

  • Added implementations of JavaScript’s _.setTimeout() and _.clearTimeout() functions. See the documentation for more details. 🎉

  • Added implementations of JavaScript’s _.setInterval() and _.clearInterval() functions. See the documentation for more details. 💪

Bug fixes

  • Fixed DateTime.factorSeconds() to work correctly with negative seconds.

  • Fixed a bug in Binder that caused This to not be set correctly within the called function — thanks to 4D’s unfortunate decision to treat empty objects as falsey.

1.0.0

New features

  • Error handling has been totally overhauled and a new, modern error handling framework has been created. Please see the error handling docs for details.

  • Fixed the properties of cs.js.Error to be accurate depending on whether the error was created by an error handler, by _.throw, or directly.

  • _.throw() now takes an options object as the third parameter.

  • Added .name and .options properties to the Error class.

  • Any 4D database/sql engine errors are thrown as DBError with no table or field.

  • _.at() and _.$at() now allow you to pass a negative index. See the documentation for details.

  • Added _.isNumericType() See the documentation for details.

  • If _.stringify() is called with an object that is cyclic, and the object responds to .toString(), that is the result. See the .toString() docs for an important warning!

  • If _.stringify() is called with a collection that contains cyclic objects, the result will be a stringified version of the collection with the cyclic objects replaced as described above for cyclic objects.

  • If _.inspect() is called with an object that is cyclic, and the object responds to .description(), that is the result.

  • _.inspect() now displays collections as a collection of the result of calling .description() on each element of the collection.

  • Added linked messages with modifiers to t() and tc(). Please see the documentation for details.

  • Added an Initialization section to the Installation section. There is now some code you need to run at startup to use js.component in your project.

  • Added _.findLastIndex() and _.lastIndexOf(). See the documentation for more details.

  • It is no longer required to install NodeJS on Windows in order to get local timezone information, nor is it required to turn on various settings on Windows. An executable (which is a stripped down version of python along with the script and its dependencies) is now included in the Resources/scripts folder.

  • The default interval for refreshing the system timezone has been reduced from 1 minute to 15 seconds. The interval can be changed by setting DateTime.timezoneRefreshInterval to a number of seconds.

  • _.sort() now accepts a property path as the first parameter. See the documentation for more details.

  • Added _.printStackTrace(). See the documentation for details.

  • Added _.splice() (from JavaScript). See the documentation for more details.

  • The documentation now includes more details about the errors that can be thrown by each function.

API changes

  • The template string syntax for _.format() has been changed to be consistent and more flexible. See the documentation for more details.

  • _.isError() has been renamed to _.error().

  • DBError now takes options as the third parameter. table and field come after and are optional.

  • To simplify the API and to prevent confusion with different styles of placeholders, t() and tc() now only take an object as the extra params.

  • _.parseJSON() now throws an error if parsing fails. See the documentation for more details.

  • All of the Regex functions now throw an error if the regex pattern is invalid. See the documentation for more details.

  • Regex.replace() now throws a TypeError if passed an invalid replacement type.

  • _.stdErrorHandler has been replaced with the constant jk std error handler.

  • The syntax for the key path in _.valueForKeyPath() has been changed and enhanced to support either object keys or collection indexes at any point in the path. See the documentation for more details.

Bug fixes

  • If _.stringify() is called with a value that is undefined, the result is now properly quoted as "<undefined>".

  • The js.component error handler was not being activated in a host db because the host maintains its own error handler method. Added _.setHostOnErrCall() to fix this. Please see the documentation for more details.

  • The cs.js.Error constructor now removes any constructors of classes whose names end with Error (e.g. SyntaxError) from the top of the stack trace. This is to deal better with error subclasses.

  • Fixed IError so that it does not generate infinite stack recursion (😱) and fixed the comments.

  • Fixed a bug in DBError.description().

  • Fixed a bug in DateTime.add() and DateTime.subtract() where null would be returned instead of the original object if the first parameter was an invalid type.

  • Fixed _.indexOf() so that the startFrom parameter behaves exactly as it does in 4D.

1.0.0-beta.5

Bug fixes

  • DateTime.add()/subtract() was not updating the UTC offset and timezone.

  • Hopefully fixed problems with html mocha reports not displaying by adding a .25 second delay before setting the html content.

1.0.0-beta.4

New features

  • The MochaRunner .include option can include a glob after the folder name. See the documentation for more details.

1.0.0-beta.3

New features

API changes

Bug fixes

  • Clicking on a test in the mocha html reporter will now open the source class to the relevant line.

  • Fixed registerSingleton() to call initShared() on the shared instance.

  • Fixed some bugs related to DateTime utc mode.

Last Updated:
Contributors: Aparajita