Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 6636996

Browse files
authored
Merge pull request #4 from buggerjs/jk-cleanup
Properly tested implementation
2 parents 1e1441f + a67e470 commit 6636996

24 files changed

+3220
-1220
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: node_js
22
node_js:
33
- '6'
4-
before_install:
5-
- npm install -g npm@latest-2
64
before_deploy:
75
- git config --global user.email "[email protected]"
86
- git config --global user.name "Jan Krems"

examples/alive.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
let x = 0;
3+
function heartbeat() {
4+
++x;
5+
}
6+
setInterval(heartbeat, 50);

examples/backtrace.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
const { exports: moduleScoped } = module;
3+
4+
function topFn(a, b = false) {
5+
const l1 = a;
6+
let t = typeof l1;
7+
var v = t.length;
8+
debugger;
9+
return b || t || v || moduleScoped;
10+
}
11+
12+
class Ctor {
13+
constructor(options) {
14+
this.options = options;
15+
}
16+
17+
m() {
18+
const mLocal = this.options;
19+
topFn(this);
20+
return mLocal;
21+
}
22+
}
23+
24+
(function () {
25+
const theOptions = { x: 42 };
26+
const arr = [theOptions];
27+
arr.forEach(options => {
28+
const obj = new Ctor(options);
29+
return obj.m();
30+
});
31+
}());

examples/break.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const x = 10;
2+
let name = 'World';
3+
name = 'Robin';
4+
function sayHello() {
5+
if (x > 0) {
6+
console.log(`Hello ${name}`);
7+
}
8+
}
9+
sayHello();
10+
debugger;
11+
setTimeout(sayHello, 10);
12+
13+
function otherFunction() {
14+
console.log('x = %d', x);
15+
}
16+
setTimeout(otherFunction, 50);

examples/cjs/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
const { add } = require('./other');
3+
4+
const sum = add(40, 2);
5+
module.exports = sum;

examples/cjs/other.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
exports.add = function add(a, b) {
3+
return a + b;
4+
};

examples/empty.js

Whitespace-only changes.

examples/myscript.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/strings.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/three-lines.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
let x = 1;
3+
x = x + 1;
4+
module.exports = x;

0 commit comments

Comments
 (0)