Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
});
this.nes = new NES({
onFrame: this.screen.setBuffer,
onStatusUpdate: console.log,
onAudioSample: this.speakers.writeSample,
sampleRate: this.speakers.getSampleRate()
});
// For debugging. (["nes"] instead of .nes to avoid VS Code type errors.)
window["nes"] = this.nes;
this.frameTimer = new FrameTimer({
onGenerateFrame: Raven.wrap(this.nes.frame),
onWriteFrame: Raven.wrap(this.screen.writeBuffer)
});
// Set up gamepad and keyboard
this.gamepadController = new GamepadController({
onButtonDown: this.nes.buttonDown,
onButtonUp: this.nes.buttonUp
});
this.gamepadController.loadGamepadConfig();
this.gamepadPolling = this.gamepadController.startPolling();
this.keyboardController = new KeyboardController({
onButtonDown: this.gamepadController.disableIfGamepadEnabled(
this.nes.buttonDown
),
onButtonUp: this.gamepadController.disableIfGamepadEnabled(
}
}
});
this.nes = new NES({
onFrame: this.screen.setBuffer,
onStatusUpdate: console.log,
onAudioSample: this.speakers.writeSample,
sampleRate: this.speakers.getSampleRate()
});
// For debugging. (["nes"] instead of .nes to avoid VS Code type errors.)
window["nes"] = this.nes;
this.frameTimer = new FrameTimer({
onGenerateFrame: Raven.wrap(this.nes.frame),
onWriteFrame: Raven.wrap(this.screen.writeBuffer)
});
// Set up gamepad and keyboard
this.gamepadController = new GamepadController({
onButtonDown: this.nes.buttonDown,
onButtonUp: this.nes.buttonUp
});
this.gamepadController.loadGamepadConfig();
this.gamepadPolling = this.gamepadController.startPolling();
this.keyboardController = new KeyboardController({
onButtonDown: this.gamepadController.disableIfGamepadEnabled(
this.nes.buttonDown
),
var throwsError = () => {
throw new Error('broken');
};
try {
throwsError();
} catch(e) {
RavenJS.captureException(e);
RavenJS.captureException(e, {tags: { key: "value" }});
}
RavenJS.context(throwsError);
RavenJS.context({tags: { key: "value" }}, throwsError);
RavenJS.context({extra: {planet: {name: 'Earth'}}}, throwsError);
setTimeout(RavenJS.wrap(throwsError), 1000);
RavenJS.wrap({logger: "my.module"}, throwsError)();
RavenJS.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)();
RavenJS.setUserContext({
email: 'matt@example.com',
id: '123'
});
RavenJS.captureMessage('Broken!');
RavenJS.captureMessage('Broken!', {tags: { key: "value" }});
RavenJS.showReportDialog({
eventId: 0815,
dsn:'1337asdf',
user: {
name: 'DefenitelyTyped',
throw new Error('broken');
};
try {
throwsError();
} catch(e) {
RavenJS.captureException(e);
RavenJS.captureException(e, {tags: { key: "value" }});
}
RavenJS.context(throwsError);
RavenJS.context({tags: { key: "value" }}, throwsError);
RavenJS.context({extra: {planet: {name: 'Earth'}}}, throwsError);
setTimeout(RavenJS.wrap(throwsError), 1000);
RavenJS.wrap({logger: "my.module"}, throwsError)();
RavenJS.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)();
RavenJS.setUserContext({
email: 'matt@example.com',
id: '123'
});
RavenJS.captureMessage('Broken!');
RavenJS.captureMessage('Broken!', {tags: { key: "value" }});
RavenJS.showReportDialog({
eventId: 0815,
dsn:'1337asdf',
user: {
name: 'DefenitelyTyped',
email: 'df@ts.ms'
wrap(options, func, _before) {
return Raven.wrap(options, func, _before);
}
}