Skip to content

Commit 9bb5a5c

Browse files
authored
Update CoffeeScript build to 1.12.7 (#128)
There are still some test failures, but this gets some work out of the way like updating the patch file to handle recent changes.
1 parent 9c2ebb3 commit 9bb5a5c

File tree

2 files changed

+38
-48
lines changed

2 files changed

+38
-48
lines changed

examples/coffeescript/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default {
22
cloneUrl: 'https://github.com/jashkenas/coffeescript.git',
33
forkUrl: '[email protected]:decaffeinate-examples/coffeescript.git',
4-
branch: '1.10.0',
4+
branch: '1.12.7',
55
useDefaultConfig: true,
66
extraDependencies: [
77
'babel-plugin-transform-remove-strict-mode',

examples/coffeescript/decaffeinate.patch

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/Cakefile.js b/Cakefile.js
2-
index d4e733b7..270db11f 100644
2+
index a70d4c7..3bb3e35 100644
33
--- a/Cakefile.js
44
+++ 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', () => {
66
// Run the CoffeeScript test suite.
77
var runTests = function (CoffeeScript) {
88
CoffeeScript.register();
@@ -11,17 +11,8 @@ index d4e733b7..270db11f 100644
1111
const startTime = Date.now();
1212
let currentFile = null;
1313
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');
2516

2617
for (const file of Array.from(files)) {
2718
- if (helpers.isCoffee(file)) {
@@ -37,38 +28,24 @@ index d4e733b7..270db11f 100644
3728
} catch (error1) {
3829
const error = error1;
3930
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', () => {
5431
diff --git a/check-coffeescript-examples.sh b/check-coffeescript-examples.sh
5532
new file mode 100755
56-
index 00000000..7638b145
33+
index 0000000..5d768d2
5734
--- /dev/null
5835
+++ b/check-coffeescript-examples.sh
5936
@@ -0,0 +1,20 @@
6037
+#!/bin/bash
6138
+
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
6441
+# making sure the output is the same. For now, it just fails on the first error.
6542
+
6643
+set -e
6744
+
6845
+rm -rf examples-tmp
6946
+mkdir examples-tmp
7047
+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
7249
+
7350
+for path in $(find coffeescript -name '*.coffee'); do
7451
+ echo "Comparing ${path}..."
@@ -78,10 +55,10 @@ index 00000000..7638b145
7855
+ echo 'Passed!'
7956
+done
8057
diff --git a/test/classes.js b/test/classes.js
81-
index 405781ad..b9787244 100644
58+
index ffff3f6..fe1bf20 100644
8259
--- a/test/classes.js
8360
+++ 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", () => {
8562

8663
Function.prototype.new = function () { return new (this)(...arguments); };
8764

@@ -91,7 +68,7 @@ index 405781ad..b9787244 100644
9168
ok((new OneClass()).function === 'function');
9269
ok(OneClass.new === 'new');
9370

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', () => {
9572

9673
const a = new A();
9774
eq(a.captured().x, 10);
@@ -101,7 +78,7 @@ index 405781ad..b9787244 100644
10178
});
10279

10380

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', () => {
10582
// Ensure that constructors invoked with splats cache the function.
10683
let called = 0;
10784
const get = function () { if (called++) { return false; } return (Type = class Type {}); };
@@ -111,7 +88,7 @@ index 405781ad..b9787244 100644
11188
});
11289

11390
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', () => {
11592
return ok(!((new Base()) instanceof Base));
11693
});
11794

@@ -122,10 +99,10 @@ index 405781ad..b9787244 100644
12299
method() { return 'no one will call me'; }
123100
}
124101
diff --git a/test/cluster.js b/test/cluster.js
125-
index acce6046..9885c14b 100644
102+
index aa78e2a..2c5a25d 100644
126103
--- a/test/cluster.js
127104
+++ b/test/cluster.js
128-
@@ -5,6 +5,10 @@
105+
@@ -12,6 +12,10 @@
129106

130107
if (typeof testingBrowser !== 'undefined' && testingBrowser !== null) { return; }
131108

@@ -137,10 +114,10 @@ index acce6046..9885c14b 100644
137114

138115
if (cluster.isMaster) {
139116
diff --git a/test/error_messages.js b/test/error_messages.js
140-
index 82058386..6606017e 100644
117+
index 18862a4..5c11837 100644
141118
--- a/test/error_messages.js
142119
+++ 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) {
144121

145122
test('patchStackTrace line patching', () => {
146123
const err = new Error('error');
@@ -150,10 +127,10 @@ index 82058386..6606017e 100644
150127

151128
test('patchStackTrace stack prelude consistent with V8', () => {
152129
diff --git a/test/importing.js b/test/importing.js
153-
index 6540e78c..00641e2b 100644
130+
index f8dec2a..91e3edd 100644
154131
--- a/test/importing.js
155132
+++ 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
157134
} else {
158135
global[magicKey] = {};
159136
if ((typeof require !== 'undefined' && require !== null ? require.extensions : undefined) != null) {
@@ -164,10 +141,10 @@ index 6540e78c..00641e2b 100644
164141
return delete global[magicKey];
165142
}
166143
diff --git a/test/operators.js b/test/operators.js
167-
index f80726d0..54ca00d6 100644
144+
index 72dec42..0f89850 100644
168145
--- a/test/operators.js
169146
+++ 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`', () => {
171148
return ok(!([1, 0 || 1].includes(0)));
172149
});
173150

@@ -177,7 +154,7 @@ index f80726d0..54ca00d6 100644
177154
let needle;
178155
return ok((needle = undefined, !Array.from({ length: 1 }).includes(needle)));
179156
});
180-
@@ -466,7 +467,8 @@ test('#3363: Modulo operator coercing order', () => {
157+
@@ -471,7 +472,8 @@ test('#3363: Modulo operator coercing order', () => {
181158
return eq(5, count);
182159
});
183160

@@ -188,10 +165,10 @@ index f80726d0..54ca00d6 100644
188165
// readability. To make sure that they do when the operand is an identifier,
189166
// test that they are consistent with another unary operator as well as another
190167
diff --git a/test/scope.js b/test/scope.js
191-
index e3baf5a2..b32c49d8 100644
168+
index 2c94e51..d35d984 100644
192169
--- a/test/scope.js
193170
+++ 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', () => {
195172
})());
196173
return eq(x, 2);
197174
});
@@ -216,3 +193,16 @@ index e3baf5a2..b32c49d8 100644
216193
test("#1973: redefining Array/Object constructors shouldn't confuse __X helpers", () => {
217194
const arr = [1, 2, 3, 4];
218195
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

Comments
 (0)