Skip to content

Infinite loop detection#73

Open
kmsalah wants to merge 2 commits intomainfrom
infiniteloop_detect
Open

Infinite loop detection#73
kmsalah wants to merge 2 commits intomainfrom
infiniteloop_detect

Conversation

@kmsalah
Copy link
Copy Markdown
Member

@kmsalah kmsalah commented Jul 22, 2022

Doesn't work yet

can't get the infiniteLoopDetector object imported into editframe.js

@kmsalah kmsalah requested a review from dmadisetti July 22, 2022 06:32
@kmsalah kmsalah self-assigned this Jul 22, 2022
Copy link
Copy Markdown
Contributor

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, hope you get working soon

src/app-frame.js Outdated
window.$ = $;

import('./scripts/frame.js');
import infiniteLoopDetector from './scripts/makeitsafe.js';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in frame.js or before the frame.js import (préférable the first)

};
try {
console.log("yoyoy");
code = infiniteLoopDetector.wrap(code)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion, take this out the try

eval(code);
} catch (e) {
if (e.type === 'InfiniteLoopError') {
console.log('infinite loop detected')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.err should print to the page

… if code works and couldnt get import working
@dmadisetti
Copy link
Copy Markdown
Contributor

What's the error you're getting?

@dmadisetti
Copy link
Copy Markdown
Contributor

Patching this into one of my branches to test out.
FYI, should break package.lock changes from other changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants