Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Closure Library v20160517

Compare
Choose a tag to compare
@blickly blickly released this 19 May 22:25

New Additions

  • goog.labs.mock.verify now supports a Mockito like VerificationMode. Factories for the common modes, times, atLeast, most, and never have been added. The default mode is atLeast(1) which was the default behavior of verify without VerificationMode. VerificationError messages have been updated to include a description from the VerificationMode about what was expected.
  • Add goog.soy.Renderer.renderSafeStyleSheet()
  • Added goog.array.concatMap method.
  • Add goog.html.sanitizer.sanitize (returns a SafeHtml from an untrusted String)
  • Debug loader will now optionally transpile if {'lang': 'es6'} is passed to goog.addDependency and "transpile.js" is available in the same directory as "base.js".
  • Added iPod detection in useragent.js and iPod OS version detection in platform.js.
  • Add new public method getUserSelectableDateRange to goog.ui.DatePicker.
  • Added fireFocusInEvent to goog.testing.events.
  • Allow testSuites to have a name via the getTestName() method on the test object.
  • goog.labs.mock.mockConstructor function to mock constructors. Static members are copied from the original constructor.

Backwards Incompatible Changes

  • goog.i18n.DateTimeSymbols and friends are now typed.
  • Make sure that you pass valid JSON to JsXmlHttpDataSource as it is now verified.
  • goog.ui.DatePicker.prototype.setUserSelectableDateRange now only accepts non-nullable goog.date.DateRange objects.
  • Opera 15 and above is now detected as Chrome to be consistent with other Chromium variants.
  • goog.ui.DatePicker.prototype.isUserSelectableDate_ now only accepts non-nullable goog.date.Date objects.
  • Delete deprecated goog.string.linkify.linkifyPlainText.
  • Breaking change for third parties: This will break your build if your code uses goog.ui.Dialog#setContent. Use setSafeHtmlContent or setTextContent instead. The method is removed because its usage can cause XSS. goog.ui.Dialog#setSafeHtmlContent or goog.ui.Dialog#setTextContent provide a safe alternative (unless the SafeHtml is constructed using legacyconversions).
  • MockControl's createFunctionMock now has non-nullable @return to match goog.testing.createFunctionMock
  • Breaking change for third parties: This will break your build if your code uses goog.dom.htmlToDocumentFragment or goog.dom.DomHelper#htmlToDocumentFragment. Use goog.dom.safeHtmlToNode or goog.dom.DomHelper#safeHtmlToNode instead.
  • goog.labs.object.is is now goog.object.is
  • Change goog.labs.mock such that later calls to #when create stubs which take precedence over previously created stubs. The previous behavior of later calls creating sequential stubs is exposed via chaining #then or #thenReturn calls to the same invocation of #when. With these changes the API now more closely matches the Java Mockito library as originally intended.

Other Changes

  • labs.testing.Environment: Enable returning a promise from user defined setUp method.
  • Update the syntax for sourceUrl in moduleloader per updated spec. See https://developers.google.com/web/updates/2013/06/sourceMappingURL-and-sourceURL-syntax-changed?hl=en.
  • Fixed UI tree typeahead handling of child node removals.
  • goog.ui.editor.ToolbarController now checks for selection to still be in the field before querying for values when updating.
  • Create a StubBinder interface to return from the public goog.labs.mock methods.
  • Added a provide for goog.i18n.DateTimeSymbolsType
  • goog.net.Cookies can now be safely included in a worker environment.
  • Have goog.math.Long use goog.reflect.cache
  • Add @typedef for strict Soy templates.
  • Fix goog.userAgentTestUtil.reinitializeUserAgent() not reinitializing goog.userAgent.EDGE_OR_IE.
  • Fix goog.dom.dataset.remove for Safari in strict mode.
  • DeferredTestCase is deprecated
  • Refactor ObjectEquals matcher to not use an assert.
  • Add forward declaration of goog.events.EventHandler.
  • Update locale data to CLDR v29.
  • Added more context to the error message when an assertion fails for setUnknown() (when tag=0). Similar explanations added to objectserializer assertion error messages. These additions should aid in finding the root cause when this assertion fails.
  • goog.events.EventType is updated with the 'timeupdate' event.
  • Support drag and drop for Opera 15 and above