1
1
diff --git a/Cakefile.js b/Cakefile.js
2
- index d4e733b7..270db11f 100644
2
+ index a70d4c7..3bb3e35 100644
3
3
--- a/Cakefile.js
4
4
+++ b/Cakefile.js
5
- @@ -279 ,6 +279 ,8 @@ task('bench', 'quick benchmark of compilation time', () => {
5
+ @@ -458 ,6 +458 ,8 @@ task('bench', 'quick benchmark of compilation time', () => {
6
6
// Run the CoffeeScript test suite.
7
7
var runTests = function (CoffeeScript) {
8
8
CoffeeScript.register();
@@ -11,17 +11,8 @@ index d4e733b7..270db11f 100644
11
11
const startTime = Date.now();
12
12
let currentFile = null;
13
13
let passedTests = 0;
14
- @@ -307,6 +309,8 @@ var runTests = function (CoffeeScript) {
15
- }
16
- };
17
-
18
- + global.skippedTest = function (description, fn) {};
19
- +
20
- // See http://wiki.ecmascript.org/doku.php?id=harmony:egal
21
- const egal = function (a, b) {
22
- if (a === b) {
23
- @@ -354,14 +358,14 @@ var runTests = function (CoffeeScript) {
24
- if (!generatorsAreAvailable) { files.splice(files.indexOf('generators.coffee'), 1); }
14
+ @@ -510,14 +512,14 @@ var runTests = function (CoffeeScript) {
15
+ const files = fs.readdirSync('test');
25
16
26
17
for (const file of Array.from(files)) {
27
18
- if (helpers.isCoffee(file)) {
@@ -37,38 +28,24 @@ index d4e733b7..270db11f 100644
37
28
} catch (error1) {
38
29
const error = error1;
39
30
failures.push({ filename, error });
40
- @@ -372,7 +376,12 @@ var runTests = function (CoffeeScript) {
41
- };
42
-
43
-
44
- - task('test', 'run the CoffeeScript language test suite', () => runTests(CoffeeScript));
45
- + task('test', 'run the CoffeeScript language test suite', () => {
46
- + const success = runTests(CoffeeScript);
47
- + if (!success) {
48
- + process.exitCode = 1;
49
- + }
50
- + });
51
-
52
-
53
- task('test:browser', 'run the test suite against the merged browser script', () => {
54
31
diff --git a/check-coffeescript-examples.sh b/check-coffeescript-examples.sh
55
32
new file mode 100755
56
- index 00000000..7638b145
33
+ index 0000000..5d768d2
57
34
--- /dev/null
58
35
+++ b/check-coffeescript-examples.sh
59
36
@@ -0,0 +1,20 @@
60
37
+ #!/bin/bash
61
38
+
62
- + # Simple shell script to compare the decaffeinated CoffeeScript 1.10.0 compiler
63
- + # with the official run , running it on all CoffeeScript files in the repo and
39
+ + # Simple shell script to compare the decaffeinated CoffeeScript 1.12.7 compiler
40
+ + # with the official one , running it on all CoffeeScript files in the repo and
64
41
+ # making sure the output is the same. For now, it just fails on the first error.
65
42
+
66
43
+ set -e
67
44
+
68
45
+ rm -rf examples-tmp
69
46
+ mkdir examples-tmp
70
47
+ cd examples-tmp
71
- + git clone https://github.com/jashkenas/coffeescript.git --branch 1.10.0
48
+ + git clone https://github.com/jashkenas/coffeescript.git --branch 1.12.7
72
49
+
73
50
+ for path in $(find coffeescript -name '*.coffee'); do
74
51
+ echo "Comparing ${path}..."
@@ -78,10 +55,10 @@ index 00000000..7638b145
78
55
+ echo 'Passed!'
79
56
+ done
80
57
diff --git a/test/classes.js b/test/classes.js
81
- index 405781ad..b9787244 100644
58
+ index ffff3f6..fe1bf20 100644
82
59
--- a/test/classes.js
83
60
+++ b/test/classes.js
84
- @@ -135 ,7 +135 ,8 @@ test("Overriding the static property new doesn't clobber Function::new", () => {
61
+ @@ -146 ,7 +146 ,8 @@ test("Overriding the static property new doesn't clobber Function::new", () => {
85
62
86
63
Function.prototype.new = function () { return new (this)(...arguments); };
87
64
@@ -91,7 +68,7 @@ index 405781ad..b9787244 100644
91
68
ok((new OneClass()).function === 'function');
92
69
ok(OneClass.new === 'new');
93
70
94
- @@ -594 ,7 +595 ,8 @@ test('variables in constructor bodies are correctly scoped', () => {
71
+ @@ -610 ,7 +611 ,8 @@ test('variables in constructor bodies are correctly scoped', () => {
95
72
96
73
const a = new A();
97
74
eq(a.captured().x, 10);
@@ -101,7 +78,7 @@ index 405781ad..b9787244 100644
101
78
});
102
79
103
80
104
- @@ -655 ,7 +657 ,8 @@ test('ensure that constructors invoked with splats return a new object', () => {
81
+ @@ -671 ,7 +673 ,8 @@ test('ensure that constructors invoked with splats return a new object', () => {
105
82
// Ensure that constructors invoked with splats cache the function.
106
83
let called = 0;
107
84
const get = function () { if (called++) { return false; } return (Type = class Type {}); };
@@ -111,7 +88,7 @@ index 405781ad..b9787244 100644
111
88
});
112
89
113
90
test("`new` shouldn't add extra parens", () => ok(new Date().constructor === Date));
114
- @@ -1094 ,7 +1097 ,8 @@ test('#2599: other typed constructors should be inherited', () => {
91
+ @@ -1115 ,7 +1118 ,8 @@ test('#2599: other typed constructors should be inherited', () => {
115
92
return ok(!((new Base()) instanceof Base));
116
93
});
117
94
@@ -122,10 +99,10 @@ index 405781ad..b9787244 100644
122
99
method() { return 'no one will call me'; }
123
100
}
124
101
diff --git a/test/cluster.js b/test/cluster.js
125
- index acce6046..9885c14b 100644
102
+ index aa78e2a..2c5a25d 100644
126
103
--- a/test/cluster.js
127
104
+++ b/test/cluster.js
128
- @@ -5 ,6 +5 ,10 @@
105
+ @@ -12 ,6 +12 ,10 @@
129
106
130
107
if (typeof testingBrowser !== 'undefined' && testingBrowser !== null) { return; }
131
108
@@ -137,10 +114,10 @@ index acce6046..9885c14b 100644
137
114
138
115
if (cluster.isMaster) {
139
116
diff --git a/test/error_messages.js b/test/error_messages.js
140
- index 82058386..6606017e 100644
117
+ index 18862a4..5c11837 100644
141
118
--- a/test/error_messages.js
142
119
+++ b/test/error_messages.js
143
- @@ -78 ,7 +78 ,7 @@ if (typeof require !== 'undefined' && require !== null) {
120
+ @@ -84 ,7 +84 ,7 @@ if (typeof require !== 'undefined' && require !== null) {
144
121
145
122
test('patchStackTrace line patching', () => {
146
123
const err = new Error('error');
@@ -150,10 +127,10 @@ index 82058386..6606017e 100644
150
127
151
128
test('patchStackTrace stack prelude consistent with V8', () => {
152
129
diff --git a/test/importing.js b/test/importing.js
153
- index 6540e78c..00641e2b 100644
130
+ index f8dec2a..91e3edd 100644
154
131
--- a/test/importing.js
155
132
+++ b/test/importing.js
156
- @@ -25 ,7 +25 ,8 @@ if ((typeof window === 'undefined' || window === null) && (typeof testingBrowser
133
+ @@ -33 ,7 +33 ,8 @@ if ((typeof window === 'undefined' || window === null) && (typeof testingBrowser
157
134
} else {
158
135
global[magicKey] = {};
159
136
if ((typeof require !== 'undefined' && require !== null ? require.extensions : undefined) != null) {
@@ -164,10 +141,10 @@ index 6540e78c..00641e2b 100644
164
141
return delete global[magicKey];
165
142
}
166
143
diff --git a/test/operators.js b/test/operators.js
167
- index f80726d0..54ca00d6 100644
144
+ index 72dec42..0f89850 100644
168
145
--- a/test/operators.js
169
146
+++ b/test/operators.js
170
- @@ -259 ,7 +259 ,8 @@ test('#1100: precedence in or-test compilation of `in`', () => {
147
+ @@ -268 ,7 +268 ,8 @@ test('#1100: precedence in or-test compilation of `in`', () => {
171
148
return ok(!([1, 0 || 1].includes(0)));
172
149
});
173
150
@@ -177,7 +154,7 @@ index f80726d0..54ca00d6 100644
177
154
let needle;
178
155
return ok((needle = undefined, !Array.from({ length: 1 }).includes(needle)));
179
156
});
180
- @@ -466 ,7 +467 ,8 @@ test('#3363: Modulo operator coercing order', () => {
157
+ @@ -471 ,7 +472 ,8 @@ test('#3363: Modulo operator coercing order', () => {
181
158
return eq(5, count);
182
159
});
183
160
@@ -188,10 +165,10 @@ index f80726d0..54ca00d6 100644
188
165
// readability. To make sure that they do when the operand is an identifier,
189
166
// test that they are consistent with another unary operator as well as another
190
167
diff --git a/test/scope.js b/test/scope.js
191
- index e3baf5a2..b32c49d8 100644
168
+ index 2c94e51..d35d984 100644
192
169
--- a/test/scope.js
193
170
+++ b/test/scope.js
194
- @@ -93 ,19 +93 ,19 @@ test('loop variable should be accessible after for-in loop', () => {
171
+ @@ -118 ,19 +118 ,19 @@ test('loop variable should be accessible after for-from loop', () => {
195
172
})());
196
173
return eq(x, 2);
197
174
});
@@ -216,3 +193,16 @@ index e3baf5a2..b32c49d8 100644
216
193
test("#1973: redefining Array/Object constructors shouldn't confuse __X helpers", () => {
217
194
const arr = [1, 2, 3, 4];
218
195
arrayEq([3, 4], arr.slice(2));
196
+ diff --git a/test/support/helpers.js b/test/support/helpers.js
197
+ index 2d0578a..a50a6b7 100644
198
+ --- a/test/support/helpers.js
199
+ +++ b/test/support/helpers.js
200
+ @@ -9,6 +9,8 @@
201
+ */
202
+ // TODO: This file was created by bulk-decaffeinate.
203
+ // Fix any style issues and re-enable lint.
204
+ + global.skippedTest = function (description, fn) {};
205
+ +
206
+ /*
207
+ * decaffeinate suggestions:
208
+ * DS102: Remove unnecessary code created because of implicit returns
0 commit comments