File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " js-slang" ,
3- "version" : " 0.2.3 " ,
3+ "version" : " 0.2.4 " ,
44 "description" : " Javascript-based interpreter for slang, written in Typescript" ,
55 "author" : {
66 "name" : " Source Academy" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,5 @@ export const UNKNOWN_LOCATION: es.SourceLocation = {
1515}
1616export const JSSLANG_PROPERTIES = {
1717 maxExecTime : 1000 ,
18- originalMaxExecTime : 1000 ,
1918 factorToIncreaseBy : 10
2019}
Original file line number Diff line number Diff line change @@ -31,12 +31,14 @@ export interface IOptions {
3131 scheduler : 'preemptive' | 'async'
3232 steps : number
3333 executionMethod : ExecutionMethod
34+ originalMaxExecTime : number
3435}
3536
3637const DEFAULT_OPTIONS : IOptions = {
3738 scheduler : 'async' ,
3839 steps : 1000 ,
39- executionMethod : 'auto'
40+ executionMethod : 'auto' ,
41+ originalMaxExecTime : 1000
4042}
4143
4244// needed to work on browsers
@@ -162,7 +164,7 @@ export function runInContext(
162164 if ( previousCode === code ) {
163165 JSSLANG_PROPERTIES . maxExecTime *= JSSLANG_PROPERTIES . factorToIncreaseBy
164166 } else {
165- JSSLANG_PROPERTIES . maxExecTime = JSSLANG_PROPERTIES . originalMaxExecTime
167+ JSSLANG_PROPERTIES . maxExecTime = theOptions . originalMaxExecTime
166168 }
167169 previousCode = code
168170 let transpiled
You can’t perform that action at this time.
0 commit comments