Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
void M(int p) {
var l = p;
}
}
class G {
}`;
if (language === 'F#') {
code = '[]\r\nlet main argv = \r\n 0';
}
else if (mode === 'script') {
code = '// C# Script uses Random as the host object.\r\nvar m = Next();';
}
mirrorsharp(document.getElementById('editor-container'), {
serviceUrl: window.location.href.replace(/^http(s?:\/\/[^/]+).*$/i, 'ws$1/mirrorsharp'),
selfDebugEnabled: true,
language,
initialText: code,
initialServerOptions: (mode !== 'regular' ? { 'x-mode': mode } : {})
});
const parts = item.split('=');
o[parts[0]] = parts[1];
return o;
}, {});
const language = (params['language'] || 'CSharp').replace('Sharp', '#');
const mode = params['mode'] || 'regular';
const textarea = document.getElementsByTagName('textarea')[0];
if (language === 'F#') {
textarea.value = '[]\r\nlet main argv = \r\n 0';
}
else if (mode === 'script') {
textarea.value = 'var messages = Context.Messages;';
}
const ms = mirrorsharp(textarea, {
serviceUrl: window.location.href.replace(/^http(s?:\/\/[^/]+).*$/i, 'ws$1/mirrorsharp'),
selfDebugEnabled: true,
language: language
});
if (mode !== 'regular')
ms.setServerOptions({ 'language': language, 'x-mode': mode });