mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-28 21:05:43 +08:00
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
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular', function(){
|
||||
describe('case', function(){
|
||||
it('should change case', function(){
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('api', function(){
|
||||
|
||||
describe('HashMap', function(){
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('Binder', function(){
|
||||
|
||||
beforeEach(function(){
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('browser', function(){
|
||||
|
||||
var browser, fakeWindow, xhr, logs, scripts, removedScripts, setTimeoutQueue;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('compiler', function(){
|
||||
var compiler, markup, attrMarkup, directives, widgets, compile, log, scope;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('filter', function() {
|
||||
|
||||
var filter = angular.filter;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("formatter", function(){
|
||||
it('should noop', function(){
|
||||
assertEquals("abc", angular.formatter.noop.format("abc"));
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('injector', function(){
|
||||
var providers;
|
||||
var cache;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('json', function(){
|
||||
it('should serialize primitives', function() {
|
||||
expect(toJson(0/0)).toEqual('null');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('parser', function() {
|
||||
describe('lexer', function() {
|
||||
it('should tokenize a string', function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("resource", function() {
|
||||
var xhr, resource, CreditCard, callback;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("ScenarioSpec: Compilation", function(){
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('scope/model', function(){
|
||||
|
||||
var temp;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('ValidatorTest', function(){
|
||||
|
||||
it('ShouldHaveThisSet', function() {
|
||||
|
||||
2
test/angular-mocksSpec.js
vendored
2
test/angular-mocksSpec.js
vendored
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('mocks', function(){
|
||||
describe('TzDate', function() {
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("directive", function(){
|
||||
|
||||
var compile, model, element;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('jqLite', function(){
|
||||
var scope, a, b, c;
|
||||
|
||||
|
||||
2
test/jquery_alias.js
vendored
2
test/jquery_alias.js
vendored
@@ -1 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
var _jQuery = jQuery;
|
||||
|
||||
2
test/jquery_remove.js
vendored
2
test/jquery_remove.js
vendored
@@ -1 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
var _jQuery = jQuery.noConflict(true);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('jstd-adapter', function() {
|
||||
var fakeJSTD = { pluginRegistrar: { register: function() {} } },
|
||||
originalNavigateTo = angular.scenario.Application.prototype.navigateTo;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("markups", function(){
|
||||
|
||||
var compile, element, scope;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('HTML', function(){
|
||||
|
||||
function expectHTML(html) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.Application', function() {
|
||||
var $window;
|
||||
var app, frames;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.Describe', function() {
|
||||
var log;
|
||||
var root;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.Future', function() {
|
||||
var future;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.ObjectModel', function() {
|
||||
var model;
|
||||
var runner;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Mock spec runner.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Mock Application
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("angular.scenario.dsl", function() {
|
||||
var $window, $root;
|
||||
var application, eventLog;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('widgets', function() {
|
||||
it('should verify that basic widgets work', function(){
|
||||
browser().navigateTo('widgets.html');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.matchers', function () {
|
||||
var matchers;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
angular.scenario.testing = angular.scenario.testing || {};
|
||||
|
||||
angular.scenario.testing.MockAngular = function() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.output.html', function() {
|
||||
var runner, model, spec, step, listeners, ui, context;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.output.json', function() {
|
||||
var output, context;
|
||||
var runner, model, $window;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.output.object', function() {
|
||||
var output;
|
||||
var runner, model, $window;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('angular.scenario.output.json', function() {
|
||||
var output, context;
|
||||
var runner, model, $window;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$cookieStore', function() {
|
||||
var scope, $browser, $cookieStore;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$cookies', function() {
|
||||
var scope, $browser;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$defer', function() {
|
||||
var scope, $browser, $defer, $exceptionHandler;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$document', function() {
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$exceptionHandler', function() {
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$invalidWidgets', function() {
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$location', function() {
|
||||
var scope, $location, $browser;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$log', function() {
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$route', function() {
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$updateView', function() {
|
||||
var scope, browser, evalCount, $updateView;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$window', function() {
|
||||
var scope;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$xhr.bulk', function() {
|
||||
var scope, $browser, $browserXhr, $log, $xhrBulk, $xhrError, log;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$xhr.cache', function() {
|
||||
var scope, $browser, $browserXhr, cache, log;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$xhr.error', function() {
|
||||
var scope, $browser, $browserXhr, $xhr, $xhrError, log;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe('$xhr', function() {
|
||||
var scope, $browser, $browserXhr, $log, $xhr, log;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
describe("widget", function(){
|
||||
var compile, element, scope;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user