Skip to content

Commit 8bcdfd6

Browse files
committed
make callback optional
1 parent 671e242 commit 8bcdfd6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as CSInterface from "./v9";
22

3-
export function evalScript(script: string, callback: (result?: any) => void): Promise<any> {
3+
export function evalScript(script: string, callback?: (result?: any) => void): Promise<any> {
44
/**
55
*
66
* @param {*} value

src/v8.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ export default class CSInterface {
515515
* @param callback Optional. A callback function that receives the result of execution.
516516
* If execution fails, the callback function receives the error message EvalScript_ErrMessage.
517517
*/
518-
evalScript(script: string, callback: (result?: any) => void | null): void {
518+
evalScript(script: string, callback?: (result?: any) => void | null): void {
519519
if (callback === null || callback === undefined) {
520520
callback = function (result) {
521521
};

0 commit comments

Comments
 (0)