Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 85944aa

Browse files
author
Michel Boudreau
committed
merging master into my local branch
2 parents 93bfc67 + 0d54950 commit 85944aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4250
-868
lines changed

.jscs.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"excludeFiles": ["src/ngLocale/**"],
33
"disallowKeywords": ["with"],
4+
"disallowKeywordsOnNewLine": ["else"],
45
"disallowMixedSpacesAndTabs": true,
56
"disallowMultipleLineStrings": true,
67
"disallowNewlineBeforeBlockStatements": true,
@@ -11,13 +12,19 @@
1112
"disallowSpacesInAnonymousFunctionExpression": {
1213
"beforeOpeningRoundBrace": true
1314
},
15+
"disallowSpacesInCallExpression": true,
1416
"disallowSpacesInFunctionDeclaration": {
1517
"beforeOpeningRoundBrace": true
1618
},
1719
"disallowSpacesInNamedFunctionExpression": {
1820
"beforeOpeningRoundBrace": true
1921
},
2022
"disallowSpacesInsideArrayBrackets": true,
23+
"requireSpaceBeforeKeywords": [
24+
"else",
25+
"while",
26+
"catch"
27+
],
2128
"disallowSpacesInsideParentheses": true,
2229
"disallowTrailingComma": true,
2330
"disallowTrailingWhitespace": true,
@@ -33,9 +40,9 @@
3340
"afterConsequent": true,
3441
"beforeAlternate": true
3542
},
43+
"requireSpacesInForStatement": true,
3644
"requireSpacesInFunction": {
3745
"beforeOpeningCurlyBrace": true
3846
},
39-
"validateLineBreaks": "LF",
40-
"validateParameterSeparator": ", "
47+
"validateLineBreaks": "LF"
4148
}

.jscs.json.todo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// that correct the existing code base issues and make the new check pass.
55

66
{
7+
"validateParameterSeparator": ", ", // Re-assert this rule when JSCS allows multiple spaces
78
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
89
"disallowImplicitTypeConversion": ["string"],
910
"disallowMultipleLineBreaks": true,
10-
"disallowKeywordsOnNewLine": ["else"],
1111
"validateJSDoc": {
1212
"checkParamNames": true,
1313
"requireParamTypes": true

benchmarks/largetable-bp/main.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<div>ngBind: <input type="radio" ng-model="benchmarkType" value="ngBind"></div>
1515
<div>ngBindOnce: <input type="radio" ng-model="benchmarkType" value="ngBindOnce"></div>
1616
<div>interpolation: <input type="radio" ng-model="benchmarkType" value="interpolation"></div>
17+
<div>interpolation + bind-once: <input type="radio" ng-model="benchmarkType" value="bindOnceInterpolation"></div>
1718
<div>attribute interpolation: <input type="radio" ng-model="benchmarkType" value="interpolationAttr"></div>
1819
<div>ngBind + fnInvocation: <input type="radio" ng-model="benchmarkType" value="ngBindFn"></div>
1920
<div>interpolation + fnInvocation: <input type="radio" ng-model="benchmarkType" value="interpolationFn"></div>
@@ -35,7 +36,7 @@ <h2>baseline binding</h2>
3536
</div>
3637
<div ng-switch-when="ngBindOnce">
3738
<h2>baseline binding once</h2>
38-
<div ng-repeat="row in data">
39+
<div ng-repeat="row in ::data">
3940
<span ng-repeat="column in ::row">
4041
<span ng-bind="::column.i"></span>:<span ng-bind="::column.j"></span>|
4142
</span>
@@ -47,6 +48,12 @@ <h2>baseline interpolation</h2>
4748
<span ng-repeat="column in row">{{column.i}}:{{column.j}}|</span>
4849
</div>
4950
</div>
51+
<div ng-switch-when="bindOnceInterpolation">
52+
<h2>baseline one-time interpolation</h2>
53+
<div ng-repeat="row in ::data">
54+
<span ng-repeat="column in ::row">{{::column.i}}:{{::column.j}}|</span>
55+
</div>
56+
</div>
5057
<div ng-switch-when="interpolationAttr">
5158
<h2>attribute interpolation</h2>
5259
<div ng-repeat="row in data">
@@ -80,4 +87,4 @@ <h2>interpolation with filter</h2>
8087
</ng-switch>
8188
</div>
8289
</div>
83-
</div>
90+
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@ngdoc error
2+
@name $compile:noctrl
3+
@fullName Controller is required.
4+
@description
5+
6+
When using the `bindToController` feature of AngularJS, a directive is required
7+
to have a Controller. A controller may be specified by adding a "controller"
8+
property to the directive definition object. Its value should be either a
9+
string, or an invokable object (a function, or an array whose last element is a
10+
function).
11+
12+
For more information, see the {@link guide/directive directives guide}.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@ngdoc error
2+
@name $compile:noident
3+
@fullName Controller identifier is required.
4+
@description
5+
6+
When using the `bindToController` feature of AngularJS, a directive is required
7+
to have a Controller identifier, which is initialized in scope with the value of
8+
the controller instance. This can be supplied using the "controllerAs" property
9+
of the directive object, or alternatively by adding " as IDENTIFIER" to the controller
10+
name.
11+
12+
For example, the following directives are valid:
13+
14+
```js
15+
// OKAY, because controller is a string with an identifier component.
16+
directive("okay", function() {
17+
return {
18+
bindToController: true,
19+
controller: "myCtrl as $ctrl"
20+
scope: {
21+
text: "@text"
22+
}
23+
};
24+
});
25+
26+
27+
// OKAY, because the directive uses the controllerAs property to override
28+
// the controller identifier.
29+
directive("okay2", function() {
30+
return {
31+
bindToController: true,
32+
controllerAs: "$ctrl",
33+
controller: function() {
34+
35+
},
36+
scope: {
37+
text: "@text"
38+
}
39+
};
40+
});
41+
```
42+
43+
While the following are invalid:
44+
45+
```js
46+
// BAD, because the controller property is a string with no identifier.
47+
directive("bad", function() {
48+
return {
49+
bindToController: true,
50+
controller: "noIdentCtrl",
51+
scope: {
52+
text: "@text"
53+
}
54+
};
55+
});
56+
57+
58+
// BAD because the controller is not a string (therefore has no identifier),
59+
// and there is no controllerAs property.
60+
directive("bad2", function() {
61+
return {
62+
bindToController: true,
63+
controller: function noControllerAs() {
64+
65+
},
66+
scope: {
67+
text: "@text"
68+
}
69+
};
70+
});
71+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@ngdoc error
2+
@name $controller:ctrlfmt
3+
@fullName Badly formed controller string
4+
@description
5+
6+
This error occurs when {@link ng.$controller $controller} service is called
7+
with a string that does not match the supported controller string formats.
8+
9+
Supported formats:
10+
11+
1. `__name__`
12+
2. `__name__ as __identifier__`
13+
14+
N'either `__name__` or `__identifier__` may contain spaces.
15+
16+
Example of incorrect usage that leads to this error:
17+
```html
18+
<!-- unclosed ng-controller attribute messes up the format -->
19+
<div ng-controller="myController>
20+
```
21+
22+
or
23+
24+
```js
25+
// does not match `__name__` or `__name__ as __identifier__`
26+
var myCtrl = $controller("mY contRoller", { $scope: newScope });
27+
```
28+
29+
or
30+
31+
```js
32+
directive("myDirective", function() {
33+
return {
34+
// does not match `__name__` or `__name__ as __identifier__`
35+
controller: "mY contRoller",
36+
link: function() {}
37+
};
38+
});
39+
```
40+
41+
To fix the examples above, ensure that the controller string matches the supported
42+
formats, and that any html attributes which are used as controller expressions are
43+
closed.
44+
45+
46+
Please consult the {@link ng.$controller $controller} service api docs to learn more.

docs/content/error/ng/cpta.ngdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@ngdoc error
2+
@name ng:cpta
3+
@fullName Copying TypedArray
4+
@description
5+
6+
Copying TypedArray's with a destination is not supported because TypedArray
7+
objects can not be mutated, they are fixed length.

docs/content/guide/production.ngdoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ There are a few things you might consider when running your AngularJS applicatio
1010

1111
## Disabling Debug Data
1212

13-
By default AngularJS attaches information about scopes to DOM nodes, and adds CSS classes
14-
to data-bound elements. The information that is not included is:
13+
By default AngularJS attaches information about binding and scopes to DOM nodes,
14+
and adds CSS classes to data-bound elements:
1515

16-
As a result of `ngBind`, `ngBindHtml` or `{{...}}` interpolations, binding data and CSS class
17-
`ng-class` is attached to the corresponding element.
16+
- As a result of `ngBind`, `ngBindHtml` or `{{...}}` interpolations, binding data and CSS class
17+
`ng-binding` are attached to the corresponding element.
1818

19-
Where the compiler has created a new scope, the scope and either `ng-scope` or `ng-isolated-scope`
19+
- Where the compiler has created a new scope, the scope and either `ng-scope` or `ng-isolated-scope`
2020
CSS class are attached to the corresponding element. These scope references can then be accessed via
2121
`element.scope()` and `element.isolateScope()`.
2222

docs/content/tutorial/step_11.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,5 +288,5 @@ learn how to improve this application with animations.
288288
<ul doc-tutorial-nav="11"></ul>
289289

290290
[restful]: http://en.wikipedia.org/wiki/Representational_State_Transfer
291-
[jasmine-matchers]: https://github.com/pivotal/jasmine/wiki/Matchers
291+
[jasmine-matchers]: http://jasmine.github.io/1.3/introduction.html#section-Matchers
292292
[bower]: http://bower.io/

lib/versions/version-info.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ var currentPackage, previousVersions, cdnVersion, gitRepoInfo;
1616
var getPackage = function() {
1717
// Search up the folder hierarchy for the first package.json
1818
var packageFolder = path.resolve('.');
19-
while ( !fs.existsSync(path.join(packageFolder, 'package.json')) ) {
19+
while (!fs.existsSync(path.join(packageFolder, 'package.json'))) {
2020
var parent = path.dirname(packageFolder);
21-
if ( parent === packageFolder) { break; }
21+
if (parent === packageFolder) { break; }
2222
packageFolder = parent;
2323
}
2424
return JSON.parse(fs.readFileSync(path.join(packageFolder,'package.json'), 'UTF-8'));
@@ -48,11 +48,11 @@ var getGitRepoInfo = function() {
4848
* @return {String} The codename if found, otherwise null/undefined
4949
*/
5050
var getCodeName = function(tagName) {
51-
var gitCatOutput = shell.exec('git cat-file -p '+ tagName, {silent:true}).output;
51+
var gitCatOutput = shell.exec('git cat-file -p ' + tagName, {silent:true}).output;
5252
var tagMessage = gitCatOutput.match(/^.*codename.*$/mg)[0];
5353
var codeName = tagMessage && tagMessage.match(/codename\((.*)\)/)[1];
5454
if (!codeName) {
55-
throw new Error("Could not extract release code name. The message of tag "+tagName+
55+
throw new Error("Could not extract release code name. The message of tag " + tagName +
5656
" must match '*codename(some release name)*'");
5757
}
5858
return codeName;
@@ -65,7 +65,7 @@ var getCodeName = function(tagName) {
6565
*/
6666
function getBuild() {
6767
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
68-
return 'sha.'+hash;
68+
return 'sha.' + hash;
6969
}
7070

7171

@@ -76,11 +76,11 @@ function getBuild() {
7676
var getTaggedVersion = function() {
7777
var gitTagResult = shell.exec('git describe --exact-match', {silent:true});
7878

79-
if ( gitTagResult.code === 0 ) {
79+
if (gitTagResult.code === 0) {
8080
var tag = gitTagResult.output.trim();
8181
var version = semver.parse(tag);
8282

83-
if ( version && semver.satisfies(version, currentPackage.branchVersion)) {
83+
if (version && semver.satisfies(version, currentPackage.branchVersion)) {
8484
version.codeName = getCodeName(tag);
8585
version.full = version.version;
8686
version.branch = 'v' + currentPackage.branchPattern.replace('*', 'x');
@@ -102,7 +102,7 @@ var getPreviousVersions = function() {
102102
var repo_url = currentPackage.repository.url;
103103
var tagResults = shell.exec('git ls-remote --tags ' + repo_url,
104104
{silent: true});
105-
if ( tagResults.code === 0 ) {
105+
if (tagResults.code === 0) {
106106
return _(tagResults.output.match(/v[0-9].*[0-9]$/mg))
107107
.map(function(tag) {
108108
var version = semver.parse(tag);
@@ -112,7 +112,7 @@ var getPreviousVersions = function() {
112112
.map(function(version) {
113113
version.docsUrl = 'http://code.angularjs.org/' + version.version + '/docs';
114114
// Versions before 1.0.2 had a different docs folder name
115-
if ( version.major < 1 || (version.major === 1 && version.minor === 0 && version.dot < 2 ) ) {
115+
if (version.major < 1 || (version.major === 1 && version.minor === 0 && version.dot < 2)) {
116116
version.docsUrl += '-' + version.version;
117117
}
118118
return version;
@@ -130,18 +130,14 @@ var getCdnVersion = function() {
130130
return semver.satisfies(tag, currentPackage.branchVersion);
131131
})
132132
.reverse()
133-
.tap(function(versions) {
134-
console.log(versions);
135-
})
136133
.reduce(function(cdnVersion, version) {
137134
if (!cdnVersion) {
138135
// Note: need to use shell.exec and curl here
139136
// as version-infos returns its result synchronously...
140-
var cdnResult = shell.exec('curl http://ajax.googleapis.com/ajax/libs/angularjs/'+version+'/angular.min.js '+
137+
var cdnResult = shell.exec('curl http://ajax.googleapis.com/ajax/libs/angularjs/' + version + '/angular.min.js ' +
141138
'--head --write-out "%{http_code}" -o /dev/null -silent',
142-
{silent: false});
143-
console.log('http://ajax.googleapis.com/ajax/libs/angularjs/'+version+'/angular.min.js');
144-
if ( cdnResult.code === 0 ) {
139+
{silent: true});
140+
if (cdnResult.code === 0) {
145141
var statusCode = cdnResult.output.trim();
146142
if (statusCode === '200') {
147143
cdnVersion = version;
@@ -163,7 +159,7 @@ var getSnapshotVersion = function() {
163159
})
164160
.last();
165161

166-
if ( !version ) {
162+
if (!version) {
167163
// a snapshot version before the first tag on the branch
168164
version = semver(currentPackage.branchPattern.replace('*','0-beta.1'));
169165
}

0 commit comments

Comments
 (0)