Skip to content

Commit cc8a08a

Browse files
authored
Merge pull request elixirscript#493 from workingjubilee/jubilee-yes-console
Actually, "yes, console"
2 parents a9a6939 + fab74b8 commit cc8a08a

5 files changed

Lines changed: 22 additions & 0 deletions

File tree

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ module.exports = {
88
'import/extensions': 'off',
99
'import/no-extraneous-dependencies': ['error', {devDependencies: true}],
1010
},
11+
'overrides': [
12+
{
13+
'files': ['*spec.js', 'priv/testrunner/**/*'],
14+
'rules': {
15+
'no-console': 'off'
16+
}
17+
}
18+
],
1119
extends: 'airbnb-base',
1220
plugins: ['import'],
1321
env: {

src/javascript/lib/core.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ function get_global() {
2727
return global;
2828
}
2929

30+
/* As long as the window check precedes this, it won't display in a browser,
31+
unless the ground cracks open and swallows JavaScript whole. */
32+
/* eslint-disable no-console */
3033
console.warn('No global state found');
34+
/* eslint-enable no-console */
35+
3136
return null;
3237
}
3338

src/javascript/lib/core/erlang_compat/elixir_errors.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
/* It is far too "meta" to warn about including a warning in a warning */
2+
/* eslint-disable no-console */
3+
14
function warn(message) {
25
const messageString = message.join('');
36
console.warn(`warning: ${messageString}`);
47

8+
59
return Symbol.for('ok');
610
}
711

src/javascript/lib/core/erlang_compat/io.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* The purpose of this module is, in fact, to do IO. */
2+
/* eslint-disable no-console */
13
import erlang from './erlang';
24

35
function put_chars(ioDevice, charData) {

src/javascript/lib/core/special_forms.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ function _with(...args) {
138138
}
139139

140140
function receive(clauses, timeout = 0, timeoutFn = () => true) {
141+
/* It's more important to warn developers than follow style guides */
142+
/* eslint-disable no-console */
141143
console.warn('Receive not supported');
144+
/* eslint-enable no-console */
142145

143146
const messages = []; // this.mailbox.get();
144147
const NOMATCH = Symbol('NOMATCH');

0 commit comments

Comments
 (0)