Skip to content

Commit

Permalink
Renamed ES5 support class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lugribossk committed Feb 24, 2013
1 parent cb18c81 commit 25e0a03
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -63,8 +63,8 @@ Continuous integration with `grunt testacular:ci`
- For it to work reliably it seems that:
- dataType must be set to "json" explicitly for it to activate.
- timeout may be required for requests to not silently disappear without succeeding or failing.
- [es5-shim and es5-sham](https://github.com/kriskowal/es5-shim) are used to enable ES5 functionality in IE 8 and PhantomJS (it's missing Function.prototype.bind()).
- These are set up as dependencies of the BrowserCompatibility class, which is set up as a dependency in the Logger class and test-main. This should cause it to always be loaded first when using the API classes or running tests.
- [es5-shim and es5-sham](https://github.com/kriskowal/es5-shim) are used to enable ES5 functionality in IE 8 and PhantomJS (it's missing Function.prototype.bind).
- These are set up as dependencies of the `Ajax` and `ES5` classes. ES5 is set up as a dependency in the Logger class and test-main. This should cause it to always be loaded first when using the API classes or running tests.

### Other
- Constructors explicitly copy properties from their data object parameter. This could be replaced with a
Expand Down
13 changes: 0 additions & 13 deletions src/main/javascript/util/BrowserCompatibility.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/main/javascript/util/ES5.js
@@ -0,0 +1,13 @@
define(["lib/es5-shim.min", "lib/es5-sham.min"],
function () {
"use strict";

/**
* Utility module that ensures all libraries needed for EcmaScript5 support in older browsers have been loaded.
*
* See <a href="https://github.com/kriskowal/es5-shim">es5-shim and es5-sham</a>.
* es5-sham is used only to inherit prototypes via Object.create().
*
* @author Bo Gotthardt
*/
});
4 changes: 2 additions & 2 deletions src/main/javascript/util/Logger.js
@@ -1,6 +1,6 @@
/*global console*/
define(["jquery", "util/Promise", "util/BrowserCompatibility"],
function ($, Promise, BrowserCompatibility) { // BrowserCompatibility only to force it being loaded before its functionality is required, as this class is one of the earliest loaded.
define(["jquery", "util/Promise", "util/ES5"],
function ($, Promise, ES5) { // ES5 only to force it being loaded before its functionality is required, as this class is one of the earliest loaded.
"use strict";

var output;
Expand Down
2 changes: 1 addition & 1 deletion src/test/javascript/test-main.js
Expand Up @@ -17,7 +17,7 @@
return (/Test\.js$/).test(file);
});

require(["/base/src/test/javascript/customMatchers.js", "util/BrowserCompatibility"].concat(allTests), function (customMatchers) {
require(["/base/src/test/javascript/customMatchers.js", "util/ES5"].concat(allTests), function (customMatchers) {
// Add the Jasmine custom matchers globally so we don't have to do it in every test.
beforeEach(function () {
this.addMatchers(customMatchers);
Expand Down

0 comments on commit 25e0a03

Please sign in to comment.