Skip to content

Commit 8c490c9

Browse files
committed
Update p5.js and p5.sound.js version to 1.4.0
1 parent fe1f989 commit 8c490c9

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -253,25 +253,26 @@ class Editor extends React.Component {
253253

254254
this.props.consoleEvents.forEach((consoleEvent) => {
255255
if (consoleEvent.method === 'error') {
256-
StackTrace.fromError(new Error(consoleEvent.data[0])).then(
257-
(stackLines) => {
258-
this.props.expandConsole();
259-
const line = stackLines.find((l) => l.fileName.startsWith('/'));
260-
if (!line) return;
261-
const fileNameArray = line.fileName.split('/');
262-
const fileName = fileNameArray.slice(-1)[0];
263-
const filePath = fileNameArray.slice(0, -1).join('/');
264-
const fileWithError = this.props.files.find(
265-
(f) => f.name === fileName && f.filePath === filePath
266-
);
267-
this.props.setSelectedFile(fileWithError.id);
268-
this._cm.addLineClass(
269-
line.lineNumber - 1,
270-
'background',
271-
'line-runtime-error'
272-
);
273-
}
274-
);
256+
const errorObj = { stack: consoleEvent.data[0] };
257+
StackTrace.fromError(errorObj).then((stackLines) => {
258+
this.props.expandConsole();
259+
const line = stackLines.find(
260+
(l) => l.fileName && l.fileName.startsWith('/')
261+
);
262+
if (!line) return;
263+
const fileNameArray = line.fileName.split('/');
264+
const fileName = fileNameArray.slice(-1)[0];
265+
const filePath = fileNameArray.slice(0, -1).join('/');
266+
const fileWithError = this.props.files.find(
267+
(f) => f.name === fileName && f.filePath === filePath
268+
);
269+
this.props.setSelectedFile(fileWithError.id);
270+
this._cm.addLineClass(
271+
line.lineNumber - 1,
272+
'background',
273+
'line-runtime-error'
274+
);
275+
});
275276
}
276277
});
277278
} else {

client/testData/testReduxStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const initialTestState = {
6868
},
6969
{
7070
name: 'index.html',
71-
content: `<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset="utf-8" /> </head> <body> <script src="sketch.js"></script> </body> </html>`,
71+
content: `<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> <meta charset="utf-8" /> </head> <body> <script src="sketch.js"></script> </body> </html>`,
7272
id: '606fc1c46045e19ca2ee2646',
7373
_id: '606fc1c46045e19ca2ee2646',
7474
fileType: 'file',

server/domain-objects/createDefaultFiles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function draw() {
99
const defaultHTML = `<!DOCTYPE html>
1010
<html>
1111
<head>
12-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/addons/p5.sound.min.js"></script>
12+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
1414
<link rel="stylesheet" type="text/css" href="style.css">
1515
<meta charset="utf-8" />
1616

server/scripts/examples.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import Project from '../models/project';
99
const defaultHTML = `<!DOCTYPE html>
1010
<html lang="en">
1111
<head>
12-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.js"></script>
13-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script>
12+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/addons/p5.sound.min.js"></script>
1414
<link rel="stylesheet" type="text/css" href="style.css">
1515
<meta charset="utf-8" />
1616
</head>

0 commit comments

Comments
 (0)