diff options
| author | Igor Minar | 2011-07-17 01:05:43 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-07-18 12:12:55 -0700 | 
| commit | fe5240732d0a80b8717be77b31d51dc3c4d737fd (patch) | |
| tree | 10ae66804417087e53df8df657de5f00ff888293 /test | |
| parent | b98c23274b4dd51205d5020a254ac53966c9ae9a (diff) | |
| download | angular.js-fe5240732d0a80b8717be77b31d51dc3c4d737fd.tar.bz2 | |
feat(strict mode): adding strict mode flag to all js files
the flag must be in all src and test files so that we get the benefit of
running in the strict mode even in jstd
the following script was used to modify all files:
for file in `find src test -name "*.js"`; do
  echo -e "'use strict';\n" > temp.txt
  cat $file >> temp.txt
  mv temp.txt $file
done
Diffstat (limited to 'test')
56 files changed, 112 insertions, 0 deletions
| diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 983e5848..3389d9b1 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular', function(){    describe('case', function(){      it('should change case', function(){ diff --git a/test/ApiSpecs.js b/test/ApiSpecs.js index 1257ad4a..137d7afd 100644 --- a/test/ApiSpecs.js +++ b/test/ApiSpecs.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('api', function(){    describe('HashMap', function(){ diff --git a/test/BinderSpec.js b/test/BinderSpec.js index 85387d8f..241bb98d 100644 --- a/test/BinderSpec.js +++ b/test/BinderSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('Binder', function(){    beforeEach(function(){ diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js index bf9cfd03..b4ad688b 100644 --- a/test/BrowserSpecs.js +++ b/test/BrowserSpecs.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('browser', function(){    var browser, fakeWindow, xhr, logs, scripts, removedScripts, setTimeoutQueue; diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js index 95f0be4c..1bfc6173 100644 --- a/test/CompilerSpec.js +++ b/test/CompilerSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('compiler', function(){    var compiler, markup, attrMarkup, directives, widgets, compile, log, scope; diff --git a/test/FiltersSpec.js b/test/FiltersSpec.js index 0a6b9124..594428f6 100644 --- a/test/FiltersSpec.js +++ b/test/FiltersSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('filter', function() {    var filter = angular.filter; diff --git a/test/FormattersSpec.js b/test/FormattersSpec.js index 1e059e6a..8f438671 100644 --- a/test/FormattersSpec.js +++ b/test/FormattersSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("formatter", function(){    it('should noop', function(){      assertEquals("abc", angular.formatter.noop.format("abc")); diff --git a/test/InjectorSpec.js b/test/InjectorSpec.js index 4bdb1008..a8ac0eee 100644 --- a/test/InjectorSpec.js +++ b/test/InjectorSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('injector', function(){    var providers;    var cache; diff --git a/test/JsonSpec.js b/test/JsonSpec.js index 0dac0318..d9b245f9 100644 --- a/test/JsonSpec.js +++ b/test/JsonSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('json', function(){    it('should serialize primitives', function() {      expect(toJson(0/0)).toEqual('null'); diff --git a/test/ParserSpec.js b/test/ParserSpec.js index d2a1c5ba..71ac9813 100644 --- a/test/ParserSpec.js +++ b/test/ParserSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('parser', function() {    describe('lexer', function() {      it('should tokenize a string', function() { diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js index 127af4ba..0b8d2187 100644 --- a/test/ResourceSpec.js +++ b/test/ResourceSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("resource", function() {    var xhr, resource, CreditCard, callback; diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js index 14ab82ce..17a10ae9 100644 --- a/test/ScenarioSpec.js +++ b/test/ScenarioSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("ScenarioSpec: Compilation", function(){    var scope; diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js index da9c517e..9cbd5f48 100644 --- a/test/ScopeSpec.js +++ b/test/ScopeSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('scope/model', function(){    var temp; diff --git a/test/ValidatorsSpec.js b/test/ValidatorsSpec.js index 4e4592bf..9f5b7b5a 100644 --- a/test/ValidatorsSpec.js +++ b/test/ValidatorsSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('ValidatorTest', function(){    it('ShouldHaveThisSet', function() { diff --git a/test/angular-mocksSpec.js b/test/angular-mocksSpec.js index c57b35e0..97949f63 100644 --- a/test/angular-mocksSpec.js +++ b/test/angular-mocksSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('mocks', function(){    describe('TzDate', function() { diff --git a/test/directivesSpec.js b/test/directivesSpec.js index a640fc50..39c52ac6 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("directive", function(){    var compile, model, element; diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 38953394..11b9db93 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('jqLite', function(){    var scope, a, b, c; diff --git a/test/jquery_alias.js b/test/jquery_alias.js index 0d884a39..d9e1222b 100644 --- a/test/jquery_alias.js +++ b/test/jquery_alias.js @@ -1 +1,3 @@ +'use strict'; +  var _jQuery = jQuery; diff --git a/test/jquery_remove.js b/test/jquery_remove.js index 9e717240..0f2ce623 100644 --- a/test/jquery_remove.js +++ b/test/jquery_remove.js @@ -1 +1,3 @@ +'use strict'; +  var _jQuery = jQuery.noConflict(true); diff --git a/test/jstd-scenario-adapter/AdapterSpecs.js b/test/jstd-scenario-adapter/AdapterSpecs.js index ccf08e3d..f0d54d3c 100644 --- a/test/jstd-scenario-adapter/AdapterSpecs.js +++ b/test/jstd-scenario-adapter/AdapterSpecs.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('jstd-adapter', function() {    var fakeJSTD = { pluginRegistrar: { register: function() {} } },        originalNavigateTo = angular.scenario.Application.prototype.navigateTo; diff --git a/test/markupSpec.js b/test/markupSpec.js index 0e5c8457..a457efae 100644 --- a/test/markupSpec.js +++ b/test/markupSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("markups", function(){    var compile, element, scope; diff --git a/test/mocks.js b/test/mocks.js index f55aa9e6..79a24bf1 100644 --- a/test/mocks.js +++ b/test/mocks.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * Mock implementation of {@link angular.service.$log} that gathers all logged messages in arrays   * (one array per logging level). These arrays are exposed as `logs` property of each of the diff --git a/test/sanitizerSpec.js b/test/sanitizerSpec.js index b42a6237..f5ac69ff 100644 --- a/test/sanitizerSpec.js +++ b/test/sanitizerSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('HTML', function(){    function expectHTML(html) { diff --git a/test/scenario/ApplicationSpec.js b/test/scenario/ApplicationSpec.js index 8c31726f..8caf1651 100644 --- a/test/scenario/ApplicationSpec.js +++ b/test/scenario/ApplicationSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.Application', function() {    var $window;    var app, frames; diff --git a/test/scenario/DescribeSpec.js b/test/scenario/DescribeSpec.js index 0322b2d4..173b0807 100644 --- a/test/scenario/DescribeSpec.js +++ b/test/scenario/DescribeSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.Describe', function() {    var log;    var root; diff --git a/test/scenario/FutureSpec.js b/test/scenario/FutureSpec.js index 827c4b35..2a75f275 100644 --- a/test/scenario/FutureSpec.js +++ b/test/scenario/FutureSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.Future', function() {    var future; diff --git a/test/scenario/ObjectModelSpec.js b/test/scenario/ObjectModelSpec.js index cb84b33f..e0da628d 100644 --- a/test/scenario/ObjectModelSpec.js +++ b/test/scenario/ObjectModelSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.ObjectModel', function() {    var model;    var runner; diff --git a/test/scenario/RunnerSpec.js b/test/scenario/RunnerSpec.js index 5ebe5690..62d84fca 100644 --- a/test/scenario/RunnerSpec.js +++ b/test/scenario/RunnerSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * Mock spec runner.   */ diff --git a/test/scenario/SpecRunnerSpec.js b/test/scenario/SpecRunnerSpec.js index 7947a3ca..0e1ffac1 100644 --- a/test/scenario/SpecRunnerSpec.js +++ b/test/scenario/SpecRunnerSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * Mock Application   */ diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js index 1d4ee360..a07d411e 100644 --- a/test/scenario/dslSpec.js +++ b/test/scenario/dslSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("angular.scenario.dsl", function() {    var $window, $root;    var application, eventLog; diff --git a/test/scenario/e2e/widgets-scenario.js b/test/scenario/e2e/widgets-scenario.js index e0a98224..ca0f8130 100644 --- a/test/scenario/e2e/widgets-scenario.js +++ b/test/scenario/e2e/widgets-scenario.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('widgets', function() {    it('should verify that basic widgets work', function(){      browser().navigateTo('widgets.html'); diff --git a/test/scenario/matchersSpec.js b/test/scenario/matchersSpec.js index 16ba1ce6..7ab41cf2 100644 --- a/test/scenario/matchersSpec.js +++ b/test/scenario/matchersSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.matchers', function () {    var matchers; diff --git a/test/scenario/mocks.js b/test/scenario/mocks.js index e023b6b0..5b7f7fcc 100644 --- a/test/scenario/mocks.js +++ b/test/scenario/mocks.js @@ -1,3 +1,5 @@ +'use strict'; +  angular.scenario.testing = angular.scenario.testing || {};  angular.scenario.testing.MockAngular = function() { diff --git a/test/scenario/output/HtmlSpec.js b/test/scenario/output/HtmlSpec.js index 1cfa268e..442e596d 100644 --- a/test/scenario/output/HtmlSpec.js +++ b/test/scenario/output/HtmlSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.output.html', function() {    var runner, model, spec, step, listeners, ui, context; diff --git a/test/scenario/output/jsonSpec.js b/test/scenario/output/jsonSpec.js index 2c56b297..06caf91c 100644 --- a/test/scenario/output/jsonSpec.js +++ b/test/scenario/output/jsonSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.output.json', function() {    var output, context;    var runner, model, $window; diff --git a/test/scenario/output/objectSpec.js b/test/scenario/output/objectSpec.js index 9fc2f7d4..d92c939d 100644 --- a/test/scenario/output/objectSpec.js +++ b/test/scenario/output/objectSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.output.object', function() {    var output;    var runner, model, $window; diff --git a/test/scenario/output/xmlSpec.js b/test/scenario/output/xmlSpec.js index a0e92639..94c3cb5a 100644 --- a/test/scenario/output/xmlSpec.js +++ b/test/scenario/output/xmlSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('angular.scenario.output.json', function() {    var output, context;    var runner, model, $window; diff --git a/test/service/cookieStoreSpec.js b/test/service/cookieStoreSpec.js index 0a493470..b37e9cb0 100644 --- a/test/service/cookieStoreSpec.js +++ b/test/service/cookieStoreSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$cookieStore', function() {    var scope, $browser, $cookieStore; diff --git a/test/service/cookiesSpec.js b/test/service/cookiesSpec.js index 11551393..3248fe23 100644 --- a/test/service/cookiesSpec.js +++ b/test/service/cookiesSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$cookies', function() {    var scope, $browser; diff --git a/test/service/deferSpec.js b/test/service/deferSpec.js index 21b8bf9c..7e59978c 100644 --- a/test/service/deferSpec.js +++ b/test/service/deferSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$defer', function() {    var scope, $browser, $defer, $exceptionHandler; diff --git a/test/service/documentSpec.js b/test/service/documentSpec.js index bd92023d..79c752e4 100644 --- a/test/service/documentSpec.js +++ b/test/service/documentSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$document', function() {    var scope; diff --git a/test/service/exceptionHandlerSpec.js b/test/service/exceptionHandlerSpec.js index 59349065..c6f13161 100644 --- a/test/service/exceptionHandlerSpec.js +++ b/test/service/exceptionHandlerSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$exceptionHandler', function() {    var scope; diff --git a/test/service/hoverSpec.js b/test/service/hoverSpec.js index 8b137891..429d26d2 100644 --- a/test/service/hoverSpec.js +++ b/test/service/hoverSpec.js @@ -1 +1,3 @@ +'use strict'; + diff --git a/test/service/invalidWidgetsSpec.js b/test/service/invalidWidgetsSpec.js index 6b965ef8..027d8d7c 100644 --- a/test/service/invalidWidgetsSpec.js +++ b/test/service/invalidWidgetsSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$invalidWidgets', function() {    var scope; diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js index 050875b1..f5a8c6b2 100644 --- a/test/service/locationSpec.js +++ b/test/service/locationSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$location', function() {    var scope, $location, $browser; diff --git a/test/service/logSpec.js b/test/service/logSpec.js index 5d8fa0db..80d085b8 100644 --- a/test/service/logSpec.js +++ b/test/service/logSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$log', function() {    var scope; diff --git a/test/service/resourceSpec.js b/test/service/resourceSpec.js index 8b137891..429d26d2 100644 --- a/test/service/resourceSpec.js +++ b/test/service/resourceSpec.js @@ -1 +1,3 @@ +'use strict'; + diff --git a/test/service/routeSpec.js b/test/service/routeSpec.js index ccdf19ec..fc2c7f9d 100644 --- a/test/service/routeSpec.js +++ b/test/service/routeSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$route', function() {    var scope; diff --git a/test/service/updateViewSpec.js b/test/service/updateViewSpec.js index beca355e..97366973 100644 --- a/test/service/updateViewSpec.js +++ b/test/service/updateViewSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$updateView', function() {    var scope, browser, evalCount, $updateView; diff --git a/test/service/windowSpec.js b/test/service/windowSpec.js index e968f560..3ead3df3 100644 --- a/test/service/windowSpec.js +++ b/test/service/windowSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$window', function() {    var scope; diff --git a/test/service/xhr.bulkSpec.js b/test/service/xhr.bulkSpec.js index 2990e666..bc8d03f8 100644 --- a/test/service/xhr.bulkSpec.js +++ b/test/service/xhr.bulkSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$xhr.bulk', function() {    var scope, $browser, $browserXhr, $log, $xhrBulk, $xhrError, log; diff --git a/test/service/xhr.cacheSpec.js b/test/service/xhr.cacheSpec.js index 4d3e3e08..905a9dae 100644 --- a/test/service/xhr.cacheSpec.js +++ b/test/service/xhr.cacheSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$xhr.cache', function() {    var scope, $browser, $browserXhr, cache, log; diff --git a/test/service/xhr.errorSpec.js b/test/service/xhr.errorSpec.js index bd9f7a92..fdca93ec 100644 --- a/test/service/xhr.errorSpec.js +++ b/test/service/xhr.errorSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$xhr.error', function() {    var scope, $browser, $browserXhr, $xhr, $xhrError, log; diff --git a/test/service/xhrSpec.js b/test/service/xhrSpec.js index 1f31bb6f..ed7cfc93 100644 --- a/test/service/xhrSpec.js +++ b/test/service/xhrSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe('$xhr', function() {    var scope, $browser, $browserXhr, $log, $xhr, log; diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 375e01c7..bb553d68 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -1,3 +1,5 @@ +'use strict'; +  /**   * Here is the problem: http://bugs.jquery.com/ticket/7292   * basically jQuery treats change event on some browsers (IE) as a diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 0d8f90eb..d9228f09 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -1,3 +1,5 @@ +'use strict'; +  describe("widget", function(){    var compile, element, scope; | 
