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

Commit 59401b8

Browse files
author
Igor Minar
committed
Merge remote branch 'upstream/master'
2 parents 9899959 + f09415d commit 59401b8

21 files changed

+994
-616
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ angular.js
44
angular-minified.js
55
angular-debug.js
66
angular-scenario.js
7+
angularjs.netrc

Rakefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include FileUtils
1+
include FileUtils
22

33
task :default => [:compile, :test]
44

@@ -91,7 +91,7 @@ task :compile do
9191
f.close
9292

9393
%x(java -jar lib/compiler-closure/compiler.jar \
94-
--compilation_level ADVANCED_OPTIMIZATIONS \
94+
--compilation_level SIMPLE_OPTIMIZATIONS \
9595
--js angular-debug.js \
9696
--externs externs.js \
9797
--create_source_map ./angular-minified.map \
@@ -120,3 +120,9 @@ task :lint do
120120
out = %x(lib/jsl/jsl -conf lib/jsl/jsl.default.conf)
121121
print out
122122
end
123+
124+
desc 'push_angularajs'
125+
task :push_angularjs do
126+
Rake::Task['compile'].execute 0
127+
sh %(cat angularjs.ftp | ftp -N angularjs.netrc angularjs.org)
128+
end

angularjs.ftp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin
2+
cd angularjs.org/ng
3+
put angular-debug.js js/angular-debug.js
4+
put angular-minified.js js/angular-minified.js
5+
put angular-scenario.js js/angular-scenario.js

perf/blank.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<script type="text/javascript">
5+
function time(timerName){
6+
var started = new Date().getTime();
7+
return {
8+
name: timerName,
9+
started: started,
10+
lastLap: {duration:0, name:'BEGIN'},
11+
lap: function(lapName){
12+
var duration = (this.lapped = new Date().getTime()) - this.started;
13+
var lastName = this.lastLap.name;
14+
this.lastLap = {duration:duration-this.lastLap.duration, name:lapName};
15+
console.log(timerName, lapName, 'TOTAL: ' + duration + ' ms.', 'since ' + lastName + ': ' + this.lastLap.duration + ' ms.');
16+
return duration;
17+
}
18+
};
19+
}
20+
window.browser = time('BROWSER');
21+
</script>
22+
<script type="text/javascript" src="../angular-minified.js" ng:autobind ng:css="css/angular.css"></script>
23+
<script type="text/javascript">
24+
window.browser.lap('parse');
25+
26+
</script>
27+
</head>
28+
<body ng:init="$window.$scope = this; $window.browser.lap('ready')" style="display:none;" ng:show="true">
29+
<a href="startup.html">reload</a>
30+
<hr/>
31+
READY
32+
</body>
33+
</html>

perf/buzz.css

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
body {
2+
background: -webkit-gradient(linear, left top, left 100, from(#bbb), to(#fff));
3+
background-repeat: no-repeat;
4+
margin: 0px;
5+
font-family: sans-serif;
6+
font-size: 12px;
7+
}
8+
9+
body > div {
10+
border-top: 1px solid white;
11+
border-bottom: 1px solid black;
12+
text-align: center;
13+
background: -webkit-gradient(linear, left top, left bottom, from(#CCC), to(#888));
14+
-webkit-background-origin: padding; -webkit-background-clip: content;
15+
}
16+
body > div button {
17+
margin: 5px;
18+
}
19+
20+
body > div span:FIRST-CHILD {
21+
float: left;
22+
font-family: monospace;
23+
font-size: 1.5em;
24+
color: black;
25+
padding: 2px 5px;
26+
}
27+
28+
body > div span:last-child {
29+
float: right;
30+
}
31+
32+
ul {
33+
list-style: none;
34+
padding: 10px;
35+
margin: 0;
36+
}
37+
38+
body > ul > li {
39+
border: 1px solid black;
40+
margin: 15px 5px;
41+
padding: 0;
42+
-webkit-box-shadow: 5px 5px 5px #888;
43+
}
44+
45+
body > ul > li > h1 {
46+
margin: 0;
47+
background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#999));
48+
font-size: 13px;
49+
border-bottom: 1px solid black;
50+
}
51+
52+
h1 > img,
53+
li > img {
54+
max-height: 30px;
55+
max-width: 30px;
56+
vertical-align: middle;
57+
padding: 3px;
58+
}
59+
60+
a > img {
61+
margin-right: 5px;
62+
margin-top: 5px;
63+
}
64+
65+
body > ul > li > h1 > a:last-child {
66+
float: right;
67+
margin: 10px;
68+
}
69+
70+
body > ul > li > div {
71+
background-color: white;
72+
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd));
73+
margin: 0;
74+
padding: 10px;
75+
}
76+
77+
body > ul > li ul {
78+
margin: 0;
79+
padding: 0;
80+
margin-left: 5px;
81+
border-left: 5px solid lightgray;
82+
}
83+
84+
body > ul > li ul > li {
85+
margin: 0;
86+
padding: 10px;
87+
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd));
88+
}
89+

perf/buzz.html

Lines changed: 89 additions & 0 deletions
Large diffs are not rendered by default.

perf/buzz_raw.html

Lines changed: 550 additions & 0 deletions
Large diffs are not rendered by default.

src/Angular.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -291,30 +291,20 @@ function escapeAttr(html) {
291291
'&quot;');
292292
}
293293

294-
function bind(_this, _function) {
295-
var curryArgs = slice.call(arguments, 2, arguments.length);
296-
if (typeof _function == 'function') {
297-
return curryArgs.length == 0 ?
298-
function() {
299-
return _function.apply(_this, arguments);
300-
} :
301-
function() {
302-
return _function.apply(_this, curryArgs.concat(slice.call(arguments, 0, arguments.length)));
303-
};
294+
function bind(self, fn) {
295+
var curryArgs = arguments.length > 2 ? slice.call(arguments, 2, arguments.length) : [];
296+
if (typeof fn == 'function') {
297+
return curryArgs.length ? function() {
298+
return arguments.length ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0, arguments.length))) : fn.apply(self, curryArgs);
299+
}: function() {
300+
return arguments.length ? fn.apply(self, arguments) : fn.call(self);
301+
};
304302
} else {
305303
// in IE, native methods ore not functions and so they can not be bound (but they don't need to be)
306-
return _function;
304+
return fn;
307305
}
308306
}
309307

310-
function outerHTML(node) {
311-
var temp = document.createElement('div');
312-
temp.appendChild(node);
313-
var outerHTML = temp.innerHTML;
314-
temp.removeChild(node);
315-
return outerHTML;
316-
}
317-
318308
function toBoolean(value) {
319309
if (value && value.length !== 0) {
320310
var v = lowercase("" + value);

src/JSON.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
array = [].constructor;
1+
var array = [].constructor;
22

33
function toJson(obj, pretty){
44
var buf = [];
55
toJsonArray(buf, obj, pretty ? "\n " : null, []);
66
return buf.join('');
77
}
88

9-
function toPrettyJson(obj) {
10-
return toJson(obj, true);
11-
}
12-
139
function fromJson(json) {
1410
if (!json) return json;
1511
try {

src/Scope.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ function setter(instance, path, value){
4444
}
4545

4646
///////////////////////////////////
47-
48-
var getterFnCache = {};
49-
var JS_KEYWORDS = {};
47+
var scopeId = 0;
48+
getterFnCache = {},
49+
compileCache = {},
50+
JS_KEYWORDS = {};
5051
foreach(
5152
["abstract", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default",
5253
"delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto",
@@ -75,7 +76,7 @@ function getterFn(path){
7576
code += ' type = angular.Global.typeOf(last);\n';
7677
code += ' fn = (angular[type.charAt(0).toUpperCase() + type.substring(1)]||{})["' + name + '"];\n';
7778
code += ' if (fn)\n';
78-
code += ' self = function(){ return fn.apply(last, [last].concat(slice.call(arguments, 0, arguments.length))); };\n';
79+
code += ' self = function(){ return fn.apply(last, [last].concat(Array.prototype.slice.call(arguments, 0, arguments.length))); };\n';
7980
code += ' }\n';
8081
}
8182
});
@@ -88,7 +89,6 @@ function getterFn(path){
8889

8990
///////////////////////////////////
9091

91-
var compileCache = {};
9292
function expressionCompile(exp){
9393
if (typeof exp === 'function') return exp;
9494
var fn = compileCache[exp];
@@ -108,7 +108,6 @@ function errorHandlerFor(element, error) {
108108
elementError(element, NG_EXCEPTION, isDefined(error) ? toJson(error) : error);
109109
}
110110

111-
var scopeId = 0;
112111
function createScope(parent, services, existing) {
113112
function Parent(){}
114113
function API(){}

src/apis.js

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@ var angularObject = {
2121
};
2222
var angularArray = {
2323
'indexOf': indexOf,
24-
'include': includes,
25-
'includeIf':function(array, value, condition) {
26-
var index = indexOf(array, value);
27-
if (condition) {
28-
if (index == -1)
29-
array.push(value);
30-
} else {
31-
array.splice(index, 1);
32-
}
33-
return array;
34-
},
3524
'sum':function(array, expression) {
3625
var fn = angular['Function']['compile'](expression);
3726
var sum = 0;
@@ -49,20 +38,6 @@ var angularArray = {
4938
array.splice(index, 1);
5039
return value;
5140
},
52-
'find':function(array, condition, defaultValue) {
53-
if (!condition) return undefined;
54-
var fn = angular['Function']['compile'](condition);
55-
foreach(array, function($){
56-
if (fn($)){
57-
defaultValue = $;
58-
return true;
59-
}
60-
});
61-
return defaultValue;
62-
},
63-
'findById':function(array, id) {
64-
return angular.Array.find(array, function($){return $.$id == id;}, null);
65-
},
6641
'filter':function(array, expression) {
6742
var predicates = [];
6843
predicates.check = function(value) {
@@ -195,52 +170,6 @@ var angularArray = {
195170
var arrayCopy = [];
196171
for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
197172
return arrayCopy.sort(reverse(comparator, descend));
198-
},
199-
'orderByToggle':function(predicate, attribute) {
200-
var STRIP = /^([+|-])?(.*)/;
201-
var ascending = false;
202-
var index = -1;
203-
foreach(predicate, function($, i){
204-
if (index == -1) {
205-
if ($ == attribute) {
206-
ascending = true;
207-
index = i;
208-
return true;
209-
}
210-
if (($.charAt(0)=='+'||$.charAt(0)=='-') && $.substring(1) == attribute) {
211-
ascending = $.charAt(0) == '+';
212-
index = i;
213-
return true;
214-
}
215-
}
216-
});
217-
if (index >= 0) {
218-
predicate.splice(index, 1);
219-
}
220-
predicate.unshift((ascending ? "-" : "+") + attribute);
221-
return predicate;
222-
},
223-
'orderByDirection':function(predicate, attribute, ascend, descend) {
224-
ascend = ascend || 'ng-ascend';
225-
descend = descend || 'ng-descend';
226-
var att = predicate[0] || '';
227-
var direction = true;
228-
if (att.charAt(0) == '-') {
229-
att = att.substring(1);
230-
direction = false;
231-
} else if(att.charAt(0) == '+') {
232-
att = att.substring(1);
233-
}
234-
return att == attribute ? (direction ? ascend : descend) : "";
235-
},
236-
'merge':function(array, index, mergeValue) {
237-
var value = array[index];
238-
if (!value) {
239-
value = {};
240-
array[index] = value;
241-
}
242-
merge(mergeValue, value);
243-
return array;
244173
}
245174
};
246175

0 commit comments

Comments
 (0)