mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-19 03:44:23 -05:00
removed dependency on v8 in favor of bin/cs
This commit is contained in:
21
test/fixtures/execution/array_comprehension.js
vendored
21
test/fixtures/execution/array_comprehension.js
vendored
@@ -1,21 +0,0 @@
|
||||
(function(){
|
||||
var nums;
|
||||
var a = [1, 2, 3];
|
||||
var d = [];
|
||||
for (var b=0, c=a.length; b<c; b++) {
|
||||
var n = a[b];
|
||||
if (n % 2 !== 0) {
|
||||
nums = d.push(n * n);
|
||||
}
|
||||
}
|
||||
nums = d;
|
||||
var result;
|
||||
var e = nums;
|
||||
var h = [];
|
||||
for (var f=0, g=e.length; f<g; f++) {
|
||||
n = e[f];
|
||||
h[f] = n * 2;
|
||||
}
|
||||
result = h;
|
||||
print(result.join(',') === '2,18');
|
||||
})();
|
||||
@@ -1,9 +0,0 @@
|
||||
(function(){
|
||||
var result;
|
||||
try {
|
||||
result = nonexistent * missing;
|
||||
} catch (error) {
|
||||
result = true;
|
||||
}
|
||||
print(result);
|
||||
})();
|
||||
27
test/fixtures/execution/calling_super.js
vendored
27
test/fixtures/execution/calling_super.js
vendored
@@ -1,27 +0,0 @@
|
||||
(function(){
|
||||
var Base = function() {
|
||||
};
|
||||
Base.prototype.func = function(string) {
|
||||
return 'zero/' + string;
|
||||
};
|
||||
var FirstChild = function() {
|
||||
};
|
||||
FirstChild.prototype.__proto__ = new Base();
|
||||
FirstChild.prototype.func = function(string) {
|
||||
return FirstChild.prototype.__proto__.func.call(this, 'one/') + string;
|
||||
};
|
||||
var SecondChild = function() {
|
||||
};
|
||||
SecondChild.prototype.__proto__ = new FirstChild();
|
||||
SecondChild.prototype.func = function(string) {
|
||||
return SecondChild.prototype.__proto__.func.call(this, 'two/') + string;
|
||||
};
|
||||
var ThirdChild = function() {
|
||||
};
|
||||
ThirdChild.prototype.__proto__ = new SecondChild();
|
||||
ThirdChild.prototype.func = function(string) {
|
||||
return ThirdChild.prototype.__proto__.func.call(this, 'three/') + string;
|
||||
};
|
||||
var result = (new ThirdChild()).func('four');
|
||||
print(result === 'zero/one/two/three/four');
|
||||
})();
|
||||
@@ -1,6 +0,0 @@
|
||||
(function(){
|
||||
var a = b = d = true;
|
||||
var c = false;
|
||||
var result = a ? b ? c ? false : d ? true : null : null : null;
|
||||
print(result);
|
||||
})();
|
||||
10
test/fixtures/execution/keyword_operators.js
vendored
10
test/fixtures/execution/keyword_operators.js
vendored
@@ -1,10 +0,0 @@
|
||||
(function(){
|
||||
var a = 5;
|
||||
var atype = typeof a;
|
||||
var b = "hello";
|
||||
var btype = typeof b;
|
||||
var Klass = function() {
|
||||
};
|
||||
var k = new Klass();
|
||||
print(atype === 'number' && btype === 'string' && k instanceof Klass);
|
||||
})();
|
||||
2
test/fixtures/execution/test_everything.cs
vendored
2
test/fixtures/execution/test_everything.cs
vendored
@@ -16,7 +16,7 @@ func: =>
|
||||
else
|
||||
c.text + '---'.
|
||||
|
||||
c.list: let for let in c.text.split('') if let is '-'.
|
||||
c.list: l for l in c.text.split('') if l is '-'.
|
||||
|
||||
c.single: c.list[1, 1][0].
|
||||
|
||||
|
||||
29
test/fixtures/execution/test_everything.js
vendored
29
test/fixtures/execution/test_everything.js
vendored
@@ -1,29 +0,0 @@
|
||||
(function(){
|
||||
var func = function() {
|
||||
var a = 3;
|
||||
var b = [];
|
||||
while (a >= 0) {
|
||||
b.push('o');
|
||||
a--;
|
||||
}
|
||||
var c = {
|
||||
"text": b
|
||||
};
|
||||
if (!(42 > 41)) {
|
||||
c = 'error';
|
||||
}
|
||||
c.text = false ? 'error' : c.text + '---';
|
||||
var d = c.text.split('');
|
||||
var g = [];
|
||||
for (var e=0, f=d.length; e<f; e++) {
|
||||
var let = d[e];
|
||||
if (let === '-') {
|
||||
c.list = g.push(let);
|
||||
}
|
||||
}
|
||||
c.list = g;
|
||||
c.single = c.list.slice(1, 1 + 1)[0];
|
||||
return c.single;
|
||||
};
|
||||
print(func() === '-');
|
||||
})();
|
||||
16
test/fixtures/execution/test_switch.js
vendored
16
test/fixtures/execution/test_switch.js
vendored
@@ -1,16 +0,0 @@
|
||||
(function(){
|
||||
var num = 10;
|
||||
var result;
|
||||
if (num === 5) {
|
||||
result = false;
|
||||
} else if (num === 'a') {
|
||||
result = false;
|
||||
} else if (num === 10) {
|
||||
result = true;
|
||||
} else if (num === 11) {
|
||||
result = false;
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
print(result);
|
||||
})();
|
||||
Reference in New Issue
Block a user