Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit 97de552

Browse files
committed
Clean up implementation of Runtime.compileScript. Fixes #62
1 parent 5d41e65 commit 97de552

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/protocols/ios/ios.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,20 @@ export abstract class IOSProtocol extends ProtocolAdapter {
318318
}
319319

320320
private onRuntimeOnCompileScript(msg: any): Promise<any> {
321-
msg.method = 'Runtime.evaluate'
322-
return Promise.resolve(msg);
321+
var params = {
322+
expression: msg.params.expression,
323+
contextId: msg.params.executionContextId
324+
}
325+
326+
this._target.callTarget('Runtime.evaluate', params).then((obj) => {
327+
var results = {
328+
scriptId: null,
329+
exceptionDetails: null
330+
}
331+
this._target.fireResultToTools(msg.id, results);
332+
});
333+
334+
return Promise.resolve(null);
323335
}
324336

325337
private onScriptParsed(msg: any): Promise<any> {

0 commit comments

Comments
 (0)