mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-10 18:11:03 +00:00
Compare commits
19 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5f69e3f64 | ||
|
|
dd24c78373 | ||
|
|
36d37c0e38 | ||
|
|
24699ee8f0 | ||
|
|
aa6a0e3fc6 | ||
|
|
8761ddc0e3 | ||
|
|
058842ad04 | ||
|
|
431bad0183 | ||
|
|
5850e61c82 | ||
|
|
d2e4e49986 | ||
|
|
0da6cc9118 | ||
|
|
cc60ba1f35 | ||
|
|
64d58a5b52 | ||
|
|
3bf4390339 | ||
|
|
e7ac7aa43b | ||
|
|
37781ed145 | ||
|
|
19ba6510d0 | ||
|
|
bc5ceee275 | ||
|
|
106af49258 |
24 changed files with 317 additions and 157 deletions
24
CHANGELOG.md
24
CHANGELOG.md
|
|
@ -82,6 +82,30 @@
|
||||||
([4ae3184c](https://github.com/angular/angular.js/commit/4ae3184c5915aac9aa00889aa2153c8e84c14966),
|
([4ae3184c](https://github.com/angular/angular.js/commit/4ae3184c5915aac9aa00889aa2153c8e84c14966),
|
||||||
[#4278](https://github.com/angular/angular.js/issues/4278), [#4225](https://github.com/angular/angular.js/issues/4225))
|
[#4278](https://github.com/angular/angular.js/issues/4278), [#4225](https://github.com/angular/angular.js/issues/4225))
|
||||||
|
|
||||||
|
## Breaking Changes
|
||||||
|
|
||||||
|
- **$http:** due to [e1cfb195](https://github.com/angular/angular.js/commit/e1cfb1957feaf89408bccf48fae6f529e57a82fe),
|
||||||
|
it is now necessary to seperately specify default HTTP headers for PUT, POST and PATCH requests, as these no longer share a single object.
|
||||||
|
|
||||||
|
To migrate your code, follow the example below:
|
||||||
|
|
||||||
|
Before:
|
||||||
|
|
||||||
|
// Will apply to POST, PUT and PATCH methods
|
||||||
|
$httpProvider.defaults.headers.post = {
|
||||||
|
"X-MY-CSRF-HEADER": "..."
|
||||||
|
};
|
||||||
|
|
||||||
|
After:
|
||||||
|
|
||||||
|
// POST, PUT and PATCH default headers must be specified seperately,
|
||||||
|
// as they do not share data.
|
||||||
|
$httpProvider.defaults.headers.post =
|
||||||
|
$httpProvider.defaults.headers.put =
|
||||||
|
$httpProviders.defaults.headers.patch = {
|
||||||
|
"X-MY-CSRF-HEADER": "..."
|
||||||
|
};
|
||||||
|
|
||||||
<a name="1.2.8"></a>
|
<a name="1.2.8"></a>
|
||||||
# 1.2.8 interdimensional-cartography (2014-01-10)
|
# 1.2.8 interdimensional-cartography (2014-01-10)
|
||||||
|
|
||||||
|
|
|
||||||
14
Gruntfile.js
14
Gruntfile.js
|
|
@ -4,18 +4,8 @@ var path = require('path');
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
//grunt plugins
|
//grunt plugins
|
||||||
grunt.loadNpmTasks('grunt-bump');
|
require('load-grunt-tasks')(grunt);
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-compress');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
||||||
grunt.loadNpmTasks('grunt-ddescribe-iit');
|
|
||||||
grunt.loadNpmTasks('grunt-jasmine-node');
|
|
||||||
grunt.loadNpmTasks("grunt-jscs-checker");
|
|
||||||
grunt.loadNpmTasks('grunt-merge-conflict');
|
|
||||||
grunt.loadNpmTasks('grunt-parallel');
|
|
||||||
grunt.loadNpmTasks('grunt-shell');
|
|
||||||
grunt.loadTasks('lib/grunt');
|
grunt.loadTasks('lib/grunt');
|
||||||
|
|
||||||
var NG_VERSION = util.getVersion();
|
var NG_VERSION = util.getVersion();
|
||||||
|
|
|
||||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License
|
The MIT License
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
|
Copyright (c) 2010-2014 Google, Inc. http://angularjs.org
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ exports.ngVersions = function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
//match the future version of AngularJS that is set in the package.json file
|
//match the future version of AngularJS that is set in the package.json file
|
||||||
return expandVersions(sortVersionsNatrually(versions), exports.ngCurrentVersion().full);
|
return expandVersions(sortVersionsNaturally(versions), exports.ngCurrentVersion().full);
|
||||||
|
|
||||||
function expandVersions(versions, latestVersion) {
|
function expandVersions(versions, latestVersion) {
|
||||||
var RC_VERSION = /rc\d/;
|
var RC_VERSION = /rc\d/;
|
||||||
|
|
@ -87,7 +87,7 @@ exports.ngVersions = function() {
|
||||||
return expanded;
|
return expanded;
|
||||||
};
|
};
|
||||||
|
|
||||||
function sortVersionsNatrually(versions) {
|
function sortVersionsNaturally(versions) {
|
||||||
var versionMap = {},
|
var versionMap = {},
|
||||||
NON_RC_RELEASE_NUMBER = 999;
|
NON_RC_RELEASE_NUMBER = 999;
|
||||||
for(var i = versions.length - 1; i >= 0; i--) {
|
for(var i = versions.length - 1; i >= 0; i--) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ var fs = require('fs');
|
||||||
var shell = require('shelljs');
|
var shell = require('shelljs');
|
||||||
var grunt = require('grunt');
|
var grunt = require('grunt');
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
|
var semver = require('semver');
|
||||||
var version;
|
var version;
|
||||||
var CSP_CSS_HEADER = '/* Include this file in your html if you are using the CSP mode. */\n\n';
|
var CSP_CSS_HEADER = '/* Include this file in your html if you are using the CSP mode. */\n\n';
|
||||||
|
|
||||||
|
|
@ -32,31 +33,82 @@ module.exports = {
|
||||||
|
|
||||||
getVersion: function(){
|
getVersion: function(){
|
||||||
if (version) return version;
|
if (version) return version;
|
||||||
|
|
||||||
var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8'));
|
var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8'));
|
||||||
var match = package.version.match(/^([^\-]*)(?:\-(.+))?$/);
|
try {
|
||||||
var semver = match[1].split('.');
|
|
||||||
|
|
||||||
var fullVersion = match[1];
|
var gitTag = getTagOfCurrentCommit();
|
||||||
|
var semVerVersion, codeName, fullVersion;
|
||||||
|
if (gitTag) {
|
||||||
|
// tagged release
|
||||||
|
fullVersion = semVerVersion = semver.valid(gitTag);
|
||||||
|
codeName = getTaggedReleaseCodeName(gitTag);
|
||||||
|
} else {
|
||||||
|
// snapshot release
|
||||||
|
semVerVersion = getSnapshotVersion();
|
||||||
|
fullVersion = semVerVersion + '-' + getSnapshotSuffix();
|
||||||
|
codeName = 'snapshot'
|
||||||
|
}
|
||||||
|
|
||||||
if (match[2]) {
|
var versionParts = semVerVersion.match(/(\d+)\.(\d+)\.(\d+)/);
|
||||||
fullVersion += '-';
|
|
||||||
fullVersion += (match[2] == 'snapshot') ? getSnapshotSuffix() : match[2];
|
version = {
|
||||||
|
full: fullVersion,
|
||||||
|
major: versionParts[1],
|
||||||
|
minor: versionParts[2],
|
||||||
|
dot: versionParts[3],
|
||||||
|
codename: codeName,
|
||||||
|
cdn: package.cdnVersion
|
||||||
|
};
|
||||||
|
|
||||||
|
return version;
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
grunt.fail.warn(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
version = {
|
function getTagOfCurrentCommit() {
|
||||||
full: fullVersion,
|
var gitTagResult = shell.exec('git describe --exact-match', {silent:true});
|
||||||
major: semver[0],
|
var gitTagOutput = gitTagResult.output.trim();
|
||||||
minor: semver[1],
|
var branchVersionPattern = new RegExp(package.branchVersion.replace('.', '\\.').replace('*', '\\d+'));
|
||||||
dot: semver[2].replace(/rc\d+/, ''),
|
if (gitTagResult.code === 0 && gitTagOutput.match(branchVersionPattern)) {
|
||||||
codename: package.codename,
|
return gitTagOutput;
|
||||||
cdn: package.cdnVersion
|
} else {
|
||||||
};
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return version;
|
function getTaggedReleaseCodeName(tagName) {
|
||||||
|
var tagMessage = shell.exec('git cat-file -p '+ tagName +' | grep "codename"', {silent:true}).output;
|
||||||
|
var codeName = tagMessage && tagMessage.match(/codename\((.*)\)/)[1];
|
||||||
|
if (!codeName) {
|
||||||
|
throw new Error("Could not extract release code name. The message of tag "+tagName+
|
||||||
|
" must match '*codename(some release name)*'");
|
||||||
|
}
|
||||||
|
return codeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSnapshotVersion() {
|
||||||
|
var oldTags = shell.exec('git tag -l v'+package.branchVersion, {silent:true}).output.trim().split('\n');
|
||||||
|
// ignore non semver versions.
|
||||||
|
oldTags = oldTags.filter(function(version) {
|
||||||
|
return version && semver.valid(version);
|
||||||
|
});
|
||||||
|
if (oldTags.length) {
|
||||||
|
oldTags.sort(semver.compare);
|
||||||
|
semVerVersion = oldTags[oldTags.length-1];
|
||||||
|
if (semVerVersion.indexOf('-') !== -1) {
|
||||||
|
semVerVersion = semver.inc(semVerVersion, 'prerelease');
|
||||||
|
} else {
|
||||||
|
semVerVersion = semver.inc(semVerVersion, 'patch');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
semVerVersion = semver.valid(package.branchVersion.replace(/\*/g, '0'));
|
||||||
|
}
|
||||||
|
return semVerVersion;
|
||||||
|
}
|
||||||
|
|
||||||
function getSnapshotSuffix() {
|
function getSnapshotSuffix() {
|
||||||
var jenkinsBuild = process.env.BUILD_NUMBER || 'local';
|
var jenkinsBuild = process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER || 'local';
|
||||||
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
|
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
|
||||||
return 'build.'+jenkinsBuild+'+sha.'+hash;
|
return 'build.'+jenkinsBuild+'+sha.'+hash;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
29
package.json
29
package.json
|
|
@ -1,20 +1,27 @@
|
||||||
{
|
{
|
||||||
"name": "angularjs",
|
"name": "angularjs",
|
||||||
"version": "1.2.11",
|
"branchVersion": "1.2.*",
|
||||||
"cdnVersion": "1.2.10",
|
"cdnVersion": "1.2.11",
|
||||||
"codename": "cryptocurrency-hyperdeflation",
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/angular/angular.js.git"
|
"url": "https://github.com/angular/angular.js.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "~0.4.2",
|
"grunt": "~0.4.2",
|
||||||
"bower": "~1.2.2",
|
|
||||||
"grunt-bump": "~0.0.13",
|
"grunt-bump": "~0.0.13",
|
||||||
"grunt-contrib-clean": "~0.5.0",
|
"grunt-contrib-clean": "~0.5.0",
|
||||||
"grunt-contrib-compress": "~0.5.2",
|
|
||||||
"grunt-contrib-connect": "~0.5.0",
|
"grunt-contrib-connect": "~0.5.0",
|
||||||
|
"grunt-contrib-compress": "~0.5.2",
|
||||||
"grunt-contrib-copy": "~0.4.1",
|
"grunt-contrib-copy": "~0.4.1",
|
||||||
|
"grunt-contrib-jshint": "~0.7.2",
|
||||||
|
"grunt-ddescribe-iit": "~0.0.1",
|
||||||
|
"grunt-jasmine-node": "git://github.com/vojtajina/grunt-jasmine-node.git#fix-grunt-exit-code",
|
||||||
|
"grunt-jscs-checker": "~0.3.2",
|
||||||
|
"grunt-merge-conflict": "~0.0.1",
|
||||||
|
"grunt-parallel": "~0.3.1",
|
||||||
|
"grunt-shell": "~0.4.0",
|
||||||
|
"load-grunt-tasks": "~0.3.0",
|
||||||
|
"bower": "~1.2.2",
|
||||||
"jasmine-node": "~1.11.0",
|
"jasmine-node": "~1.11.0",
|
||||||
"q": "~0.9.2",
|
"q": "~0.9.2",
|
||||||
"q-io": "~1.10.6",
|
"q-io": "~1.10.6",
|
||||||
|
|
@ -33,16 +40,10 @@
|
||||||
"yaml-js": "~0.0.8",
|
"yaml-js": "~0.0.8",
|
||||||
"marked": "0.2.9",
|
"marked": "0.2.9",
|
||||||
"rewire": "1.1.3",
|
"rewire": "1.1.3",
|
||||||
"grunt-jasmine-node": "git://github.com/vojtajina/grunt-jasmine-node.git#fix-grunt-exit-code",
|
|
||||||
"grunt-parallel": "~0.3.1",
|
|
||||||
"grunt-ddescribe-iit": "~0.0.1",
|
|
||||||
"grunt-merge-conflict": "~0.0.1",
|
|
||||||
"promises-aplus-tests": "~1.3.2",
|
"promises-aplus-tests": "~1.3.2",
|
||||||
"grunt-shell": "~0.4.0",
|
|
||||||
"semver": "~2.1.0",
|
"semver": "~2.1.0",
|
||||||
"lodash": "~2.1.0",
|
"lodash": "~2.1.0",
|
||||||
"browserstacktunnel-wrapper": "~1.1.1",
|
"browserstacktunnel-wrapper": "~1.1.1"
|
||||||
"grunt-jscs-checker": "~0.3.2"
|
|
||||||
},
|
},
|
||||||
"licenses": [
|
"licenses": [
|
||||||
{
|
{
|
||||||
|
|
@ -50,7 +51,5 @@
|
||||||
"url": "https://github.com/angular/angular.js/blob/master/LICENSE"
|
"url": "https://github.com/angular/angular.js/blob/master/LICENSE"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {}
|
||||||
"grunt-contrib-jshint": "~0.7.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "############################################"
|
|
||||||
echo "## Remove "-snapshot" from version ########"
|
|
||||||
echo "############################################"
|
|
||||||
|
|
||||||
ARG_DEFS=()
|
|
||||||
|
|
||||||
function run {
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
replaceJsonProp "package.json" "version" "(.*)-snapshot" "\2"
|
|
||||||
VERSION=$(readJsonProp "package.json" "version")
|
|
||||||
|
|
||||||
git add package.json
|
|
||||||
git commit -m "chore(release): cut v$VERSION release"
|
|
||||||
git tag -m "v$VERSION" v$VERSION
|
|
||||||
}
|
|
||||||
|
|
||||||
source $(dirname $0)/../utils.inc
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "############################################"
|
|
||||||
echo "## Increment version, add "-snapshot" and set version name ##"
|
|
||||||
echo "############################################"
|
|
||||||
|
|
||||||
ARG_DEFS=(
|
|
||||||
"--next-version-type=(patch|minor|major)"
|
|
||||||
"--next-version-name=(.+)"
|
|
||||||
)
|
|
||||||
|
|
||||||
function run {
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
grunt bump:$NEXT_VERSION_TYPE
|
|
||||||
NEXT_VERSION=$(readJsonProp "package.json" "version")
|
|
||||||
replaceJsonProp "package.json" "version" "(.*)" "\2-snapshot"
|
|
||||||
replaceJsonProp "package.json" "codename" ".*" "$NEXT_VERSION_NAME"
|
|
||||||
|
|
||||||
git add package.json
|
|
||||||
git commit -m "chore(release): start v$NEXT_VERSION ($NEXT_VERSION)"
|
|
||||||
}
|
|
||||||
|
|
||||||
source $(dirname $0)/../utils.inc
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Script for updating angular.js repo from current local build.
|
|
||||||
|
|
||||||
echo "#################################"
|
|
||||||
echo "## Update angular.js ###"
|
|
||||||
echo "#################################"
|
|
||||||
|
|
||||||
ARG_DEFS=(
|
|
||||||
"--action=(prepare|publish)"
|
|
||||||
"--next-version-type=(patch|minor|major)"
|
|
||||||
"--next-version-name=(.+)"
|
|
||||||
"[--no-test=(true|false)]"
|
|
||||||
)
|
|
||||||
|
|
||||||
function init {
|
|
||||||
cd ../..
|
|
||||||
}
|
|
||||||
|
|
||||||
function prepare() {
|
|
||||||
./scripts/angular.js/finalize-version.sh
|
|
||||||
|
|
||||||
# Build
|
|
||||||
if [[ $NO_TEST == "true" ]]; then
|
|
||||||
npm install --color false
|
|
||||||
grunt ci-checks package --no-color
|
|
||||||
else
|
|
||||||
./jenkins_build.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
./scripts/angular.js/initialize-new-version.sh --next-version-type=$NEXT_VERSION_TYPE --next-version-name=$NEXT_VERSION_NAME
|
|
||||||
}
|
|
||||||
|
|
||||||
function publish() {
|
|
||||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
||||||
# push the commits to github
|
|
||||||
git push origin $BRANCH
|
|
||||||
# push the release tag
|
|
||||||
git push origin v`cat build/version.txt`
|
|
||||||
}
|
|
||||||
|
|
||||||
source $(dirname $0)/../utils.inc
|
|
||||||
42
scripts/angular.js/tag-release.sh
Executable file
42
scripts/angular.js/tag-release.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Tags a release
|
||||||
|
# so that travis can do the actual release.
|
||||||
|
|
||||||
|
echo "#################################"
|
||||||
|
echo "## Tag angular.js for a release #"
|
||||||
|
echo "#################################"
|
||||||
|
|
||||||
|
ARG_DEFS=(
|
||||||
|
"--action=(prepare|publish)"
|
||||||
|
"--commit-sha=(.*)"
|
||||||
|
# the version number of the release.
|
||||||
|
# e.g. 1.2.12 or 1.2.12-rc.1
|
||||||
|
"--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)"
|
||||||
|
"--version-name=(.+)"
|
||||||
|
)
|
||||||
|
|
||||||
|
function checkVersionNumber() {
|
||||||
|
BRANCH_PATTERN=$(readJsonProp "package.json" "branchVersion")
|
||||||
|
if [[ $VERSION_NUMBER != $BRANCH_PATTERN ]]; then
|
||||||
|
echo "version-number needs to match $BRANCH_PATTERN on this branch"
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function init {
|
||||||
|
cd ../..
|
||||||
|
checkVersionNumber
|
||||||
|
TAG_NAME="v$VERSION_NUMBER"
|
||||||
|
}
|
||||||
|
|
||||||
|
function prepare() {
|
||||||
|
git tag "$TAG_NAME" -m "chore(release): $TAG_NAME codename($VERSION_NAME)" "$COMMIT_SHA"
|
||||||
|
}
|
||||||
|
|
||||||
|
function publish() {
|
||||||
|
# push the tag to github
|
||||||
|
git push origin $TAG_NAME
|
||||||
|
}
|
||||||
|
|
||||||
|
source $(dirname $0)/../utils.inc
|
||||||
|
|
@ -1,38 +1,63 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# tags the current commit as a release and publishes all artifacts to
|
||||||
|
# the different repositories.
|
||||||
|
# Note: This will also works if the commit is in the past!
|
||||||
|
|
||||||
echo "#################################"
|
echo "#################################"
|
||||||
echo "#### Cut release ################"
|
echo "#### cut release ############"
|
||||||
echo "#################################"
|
echo "#################################"
|
||||||
|
|
||||||
ARG_DEFS=(
|
ARG_DEFS=(
|
||||||
"--next-version-type=(patch|minor|major)"
|
|
||||||
"--next-version-name=(.+)"
|
|
||||||
# require the git dryrun flag so the script can't be run without
|
# require the git dryrun flag so the script can't be run without
|
||||||
# thinking about this!
|
# thinking about this!
|
||||||
"--git-push-dryrun=(true|false)"
|
"--git-push-dryrun=(true|false)"
|
||||||
"[--no-test=(true|false)]"
|
# The sha to release. Needs to be the same as HEAD.
|
||||||
|
# given as parameter to double check.
|
||||||
|
"--commit-sha=(.*)"
|
||||||
|
# the version number of the release.
|
||||||
|
# e.g. 1.2.12 or 1.2.12-rc.1
|
||||||
|
"--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)"
|
||||||
|
# the codename of the release
|
||||||
|
"--version-name=(.+)"
|
||||||
)
|
)
|
||||||
|
|
||||||
function init {
|
function init {
|
||||||
NG_ARGS=("$@")
|
if [[ $(git rev-parse --short HEAD) != $COMMIT_SHA ]]; then
|
||||||
|
echo "HEAD is not at $COMMIT_SHA"
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! $VERBOSE ]]; then
|
if [[ ! $VERBOSE ]]; then
|
||||||
VERBOSE=false
|
VERBOSE=false
|
||||||
fi
|
fi
|
||||||
if [[ ! $NO_TEST ]]; then
|
|
||||||
NO_TEST=false
|
|
||||||
fi
|
|
||||||
VERBOSE_ARG="--verbose=$VERBOSE"
|
VERBOSE_ARG="--verbose=$VERBOSE"
|
||||||
NO_TEST_ARG="--no_test=$NO_TEST"
|
}
|
||||||
|
|
||||||
|
function build {
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
npm install --color false
|
||||||
|
grunt ci-checks package --no-color
|
||||||
|
|
||||||
|
cd $SCRIPT_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
function phase {
|
function phase {
|
||||||
ACTION_ARG="--action=$1"
|
ACTION_ARG="--action=$1"
|
||||||
../angular.js/publish.sh $ACTION_ARG $VERBOSE_ARG $NO_TEST_ARG \
|
../angular.js/tag-release.sh $ACTION_ARG $VERBOSE_ARG\
|
||||||
--next-version-type=$NEXT_VERSION_TYPE --next-version-name=$NEXT_VERSION_NAME
|
--version-number=$VERSION_NUMBER --version-name=$VERSION_NAME\
|
||||||
|
--commit-sha=$COMMIT_SHA
|
||||||
|
|
||||||
|
if [[ $1 == "prepare" ]]; then
|
||||||
|
# The build requires the tag to be set already!
|
||||||
|
build
|
||||||
|
fi
|
||||||
|
|
||||||
../code.angularjs.org/publish.sh $ACTION_ARG $VERBOSE_ARG
|
../code.angularjs.org/publish.sh $ACTION_ARG $VERBOSE_ARG
|
||||||
../bower/publish.sh $ACTION_ARG $VERBOSE_ARG
|
../bower/publish.sh $ACTION_ARG $VERBOSE_ARG
|
||||||
../angular-seed/publish.sh $ACTION_ARG $VERBOSE_ARG $NO_TEST_ARG
|
../angular-seed/publish.sh $ACTION_ARG $VERBOSE_ARG --no-test=true
|
||||||
../angular-phonecat/publish.sh $ACTION_ARG $VERBOSE_ARG $NO_TEST_ARG
|
../angular-phonecat/publish.sh $ACTION_ARG $VERBOSE_ARG --no-test=true
|
||||||
}
|
}
|
||||||
|
|
||||||
function run {
|
function run {
|
||||||
|
|
|
||||||
|
|
@ -772,7 +772,7 @@ function shallowCopy(src, dst) {
|
||||||
for(var key in src) {
|
for(var key in src) {
|
||||||
// shallowCopy is only ever called by $compile nodeLinkFn, which has control over src
|
// shallowCopy is only ever called by $compile nodeLinkFn, which has control over src
|
||||||
// so we don't need to worry about using our custom hasOwnProperty here
|
// so we don't need to worry about using our custom hasOwnProperty here
|
||||||
if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') {
|
if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
|
||||||
dst[key] = src[key];
|
dst[key] = src[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,9 @@ function JQLite(element) {
|
||||||
if (element instanceof JQLite) {
|
if (element instanceof JQLite) {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
if (isString(element)) {
|
||||||
|
element = trim(element);
|
||||||
|
}
|
||||||
if (!(this instanceof JQLite)) {
|
if (!(this instanceof JQLite)) {
|
||||||
if (isString(element) && element.charAt(0) != '<') {
|
if (isString(element) && element.charAt(0) != '<') {
|
||||||
throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
|
throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
|
||||||
|
|
|
||||||
|
|
@ -1196,7 +1196,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||||
hasTranscludeDirective = true;
|
hasTranscludeDirective = true;
|
||||||
|
|
||||||
// Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
|
// Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
|
||||||
// This option should only be used by directives that know how to how to safely handle element transclusion,
|
// This option should only be used by directives that know how to safely handle element transclusion,
|
||||||
// where the transcluded nodes are added or replaced after linking.
|
// where the transcluded nodes are added or replaced after linking.
|
||||||
if (!directive.$$tlb) {
|
if (!directive.$$tlb) {
|
||||||
assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);
|
assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,6 @@ function classDirective(name, selector) {
|
||||||
expect(ps.get(1).getAttribute('class')).toBe('');
|
expect(ps.get(1).getAttribute('class')).toBe('');
|
||||||
element(by.model('style')).clear();
|
element(by.model('style')).clear();
|
||||||
element(by.model('style')).sendKeys('red');
|
element(by.model('style')).sendKeys('red');
|
||||||
browser.debugger();
|
|
||||||
expect(ps.get(1).getAttribute('class')).toBe('red');
|
expect(ps.get(1).getAttribute('class')).toBe('red');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,20 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responseType) {
|
if (responseType) {
|
||||||
xhr.responseType = responseType;
|
try {
|
||||||
|
xhr.responseType = responseType;
|
||||||
|
} catch (e) {
|
||||||
|
// WebKit added support for the json responseType value on 09/03/2013
|
||||||
|
// https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are
|
||||||
|
// known to throw when setting the value "json" as the response type. Other older
|
||||||
|
// browsers implementing the responseType
|
||||||
|
//
|
||||||
|
// The json response type can be ignored if not supported, because JSON payloads are
|
||||||
|
// parsed on the client-side regardless.
|
||||||
|
if (responseType !== 'json') {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr.send(post || null);
|
xhr.send(post || null);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function $LogProvider(){
|
||||||
* @name ng.$logProvider#debugEnabled
|
* @name ng.$logProvider#debugEnabled
|
||||||
* @methodOf ng.$logProvider
|
* @methodOf ng.$logProvider
|
||||||
* @description
|
* @description
|
||||||
* @param {string=} flag enable or disable debug level messages
|
* @param {boolean=} flag enable or disable debug level messages
|
||||||
* @returns {*} current value if used as getter or itself (chaining) if used as setter
|
* @returns {*} current value if used as getter or itself (chaining) if used as setter
|
||||||
*/
|
*/
|
||||||
this.debugEnabled = function(flag) {
|
this.debugEnabled = function(flag) {
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
* constructed via `$q.reject`, the promise will be rejected instead.
|
* constructed via `$q.reject`, the promise will be rejected instead.
|
||||||
* - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
|
* - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
|
||||||
* resolving it with a rejection constructed via `$q.reject`.
|
* resolving it with a rejection constructed via `$q.reject`.
|
||||||
* - `notify(value)` - provides updates on the status of the promises execution. This may be called
|
* - `notify(value)` - provides updates on the status of the promise's execution. This may be called
|
||||||
* multiple times before the promise is either resolved or rejected.
|
* multiple times before the promise is either resolved or rejected.
|
||||||
*
|
*
|
||||||
* **Properties**
|
* **Properties**
|
||||||
|
|
|
||||||
6
src/ngMock/angular-mocks.js
vendored
6
src/ngMock/angular-mocks.js
vendored
|
|
@ -504,6 +504,7 @@ angular.mock.$IntervalProvider = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
$interval.cancel = function(promise) {
|
$interval.cancel = function(promise) {
|
||||||
|
if(!promise) return false;
|
||||||
var fnIndex;
|
var fnIndex;
|
||||||
|
|
||||||
angular.forEach(repeatFns, function(fn, index) {
|
angular.forEach(repeatFns, function(fn, index) {
|
||||||
|
|
@ -2138,9 +2139,8 @@ if(window.jasmine || window.mocha) {
|
||||||
}
|
}
|
||||||
for(var i = 0, ii = blockFns.length; i < ii; i++) {
|
for(var i = 0, ii = blockFns.length; i < ii; i++) {
|
||||||
try {
|
try {
|
||||||
/* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */
|
// jasmine sets this to be the current spec, so we are mimicing that
|
||||||
injector.invoke(blockFns[i] || angular.noop, this);
|
injector.invoke(blockFns[i] || angular.noop, currentSpec);
|
||||||
/* jshint +W040 */
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.stack && errorForStack) {
|
if (e.stack && errorForStack) {
|
||||||
throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
|
throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ function shallowClearAndCopy(src, dst) {
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var key in src) {
|
for (var key in src) {
|
||||||
if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') {
|
if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
|
||||||
dst[key] = src[key];
|
dst[key] = src[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ describe('angular', function() {
|
||||||
expect(copy.key).toBe(original.key);
|
expect(copy.key).toBe(original.key);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not copy $$ properties nor prototype properties', function() {
|
it('should omit "$$"-prefixed properties', function() {
|
||||||
var original = {$$some: true, $$: true};
|
var original = {$$some: true, $$: true};
|
||||||
var clone = {};
|
var clone = {};
|
||||||
|
|
||||||
|
|
@ -198,6 +198,27 @@ describe('angular', function() {
|
||||||
expect(clone.$$some).toBeUndefined();
|
expect(clone.$$some).toBeUndefined();
|
||||||
expect(clone.$$).toBeUndefined();
|
expect(clone.$$).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should copy "$"-prefixed properties from copy', function() {
|
||||||
|
var original = {$some: true};
|
||||||
|
var clone = {};
|
||||||
|
|
||||||
|
expect(shallowCopy(original, clone)).toBe(clone);
|
||||||
|
expect(clone.$some).toBe(original.$some);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should omit properties from prototype chain', function() {
|
||||||
|
var original, clone = {};
|
||||||
|
function Func() {};
|
||||||
|
Func.prototype.hello = "world";
|
||||||
|
|
||||||
|
original = new Func();
|
||||||
|
original.goodbye = "world";
|
||||||
|
|
||||||
|
expect(shallowCopy(original, clone)).toBe(clone);
|
||||||
|
expect(clone.hello).toBeUndefined();
|
||||||
|
expect(clone.goodbye).toBe("world");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('elementHTML', function() {
|
describe('elementHTML', function() {
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,17 @@ describe('jqLite', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('should allow construction of html with leading whitespace', function() {
|
||||||
|
var nodes = jqLite(' \n\r \r\n<div>1</div><span>2</span>');
|
||||||
|
expect(nodes[0].parentNode).toBeDefined();
|
||||||
|
expect(nodes[0].parentNode.nodeType).toBe(11); /** Document Fragment **/;
|
||||||
|
expect(nodes[0].parentNode).toBe(nodes[1].parentNode);
|
||||||
|
expect(nodes.length).toBe(2);
|
||||||
|
expect(nodes[0].innerHTML).toBe('1');
|
||||||
|
expect(nodes[1].innerHTML).toBe('2');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should allow creation of comment tags', function() {
|
it('should allow creation of comment tags', function() {
|
||||||
var nodes = jqLite('<!-- foo -->');
|
var nodes = jqLite('<!-- foo -->');
|
||||||
expect(nodes.length).toBe(1);
|
expect(nodes.length).toBe(1);
|
||||||
|
|
|
||||||
24
test/ngMock/angular-mocksSpec.js
vendored
24
test/ngMock/angular-mocksSpec.js
vendored
|
|
@ -509,6 +509,11 @@ describe('ngMock', function() {
|
||||||
|
|
||||||
it('should not throw a runtime exception when given an undefined promise',
|
it('should not throw a runtime exception when given an undefined promise',
|
||||||
inject(function($interval) {
|
inject(function($interval) {
|
||||||
|
var task1 = jasmine.createSpy('task1'),
|
||||||
|
promise1;
|
||||||
|
|
||||||
|
promise1 = $interval(task1, 1000, 1);
|
||||||
|
|
||||||
expect($interval.cancel()).toBe(false);
|
expect($interval.cancel()).toBe(false);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
@ -864,6 +869,25 @@ describe('ngMock', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('this', function() {
|
||||||
|
|
||||||
|
it('should set `this` to be the jasmine context', inject(function() {
|
||||||
|
expect(this instanceof jasmine.Spec).toBe(true);
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should set `this` to be the jasmine context when inlined in a test', function() {
|
||||||
|
var tested = false;
|
||||||
|
|
||||||
|
inject(function() {
|
||||||
|
expect(this instanceof jasmine.Spec).toBe(true);
|
||||||
|
tested = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(tested).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// We don't run the following tests on IE8.
|
// We don't run the following tests on IE8.
|
||||||
// IE8 throws "Object does not support this property or method." error,
|
// IE8 throws "Object does not support this property or method." error,
|
||||||
// when thrown from a function defined on window (which `inject` is).
|
// when thrown from a function defined on window (which `inject` is).
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,49 @@ describe("resource", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('shallow copy', function() {
|
||||||
|
it('should make a copy', function() {
|
||||||
|
var original = {key:{}};
|
||||||
|
var copy = shallowClearAndCopy(original);
|
||||||
|
expect(copy).toEqual(original);
|
||||||
|
expect(copy.key).toBe(original.key);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('should omit "$$"-prefixed properties', function() {
|
||||||
|
var original = {$$some: true, $$: true};
|
||||||
|
var clone = {};
|
||||||
|
|
||||||
|
expect(shallowClearAndCopy(original, clone)).toBe(clone);
|
||||||
|
expect(clone.$$some).toBeUndefined();
|
||||||
|
expect(clone.$$).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('should copy "$"-prefixed properties from copy', function() {
|
||||||
|
var original = {$some: true};
|
||||||
|
var clone = {};
|
||||||
|
|
||||||
|
expect(shallowClearAndCopy(original, clone)).toBe(clone);
|
||||||
|
expect(clone.$some).toBe(original.$some);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
it('should omit properties from prototype chain', function() {
|
||||||
|
var original, clone = {};
|
||||||
|
function Func() {};
|
||||||
|
Func.prototype.hello = "world";
|
||||||
|
|
||||||
|
original = new Func();
|
||||||
|
original.goodbye = "world";
|
||||||
|
|
||||||
|
expect(shallowClearAndCopy(original, clone)).toBe(clone);
|
||||||
|
expect(clone.hello).toBeUndefined();
|
||||||
|
expect(clone.goodbye).toBe("world");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should default to empty parameters', function() {
|
it('should default to empty parameters', function() {
|
||||||
$httpBackend.expect('GET', 'URL').respond({});
|
$httpBackend.expect('GET', 'URL').respond({});
|
||||||
$resource('URL').query();
|
$resource('URL').query();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue