Skip to content

Commit

Permalink
add mock
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Dec 17, 2023
1 parent 9b7d5bf commit 0469eee
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 0 deletions.
47 changes: 47 additions & 0 deletions mock/minify/comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* eslint-disable no-trailing-spaces,line-comment-position,no-inline-comments,indent,no-multi-spaces,no-multiple-empty-lines */
// LineComment

console.log('some//thing'); // comment /*

// comment /*
console.log('some//thing/*'); /*
ddd
*/
console.log('some/*/thing');

console.log(`
/*
//
*/
`);

/**
* BlockComment
*
*/ console.log('some/*/thing');

console.log('some//thing'); // end of line

/*
connected
*/ console.log('some*//thing'); /*
cross line
*/

console.log('some*//thing'); /*
cross line
*/

console.log('some*//thing'); /* inline */ console.log('some*//thing');

/*
multiple line
//
*/

/**/ console.log('some*//thing'); /*
console.log('some//*thing')
*/


5 changes: 5 additions & 0 deletions mock/minify/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ function callback() {

}

/*
block comment
*/

function other() {

}

/* inline block */
function method(v) {
// console.log("method", v);
if (v === 2) {
Expand Down
5 changes: 5 additions & 0 deletions mock/minify/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ <h3 class="red inline-used and-used">

<script src="with-map/fps-detector.js"></script>

<script src="comments.js"></script>

<script src="demo.js"></script>
<script src="js/demo.js"></script>


<script src="browser.js"></script>
<script src="ie-polyfill.js"></script>
<script src="redirection.js"></script>

<script src="with-map/coverage-data.js"></script>
<script src="with-map/monocart-v8.js"></script>

<!-- <script src="with-map/lithops-ui.js"></script> -->

<script>
console.log('body');
Expand Down
2 changes: 2 additions & 0 deletions mock/minify/with-map/lithops-ui.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mock/minify/with-map/lithops-ui.js.map

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions mock/src/branch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// AssignmentPattern
const fun = (a = 0) => {

// LogicalExpression
const b = a || 2;

const c = a || b || 3;
console.log(c);

// single if
// if (a) {
// console.log(a);
// }

// if (a) {
// console.log(a);
// } else if (b) {
// console.log(b);
// }

// switch (a) {
// case 1:
// console.log(1);
// break;
// case 2:
// case 3:
// console.log(1);
// break;
// default:
// console.log('default');
// }

return b;
};


fun();
1 change: 1 addition & 0 deletions mock/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './app.js';
import './branch.js';

export function foo(argument) {
console.log('this is foo');
Expand Down

0 comments on commit 0469eee

Please sign in to comment.