[KJS] Allow calling function from KJSObject by adding a call function to its api
Needs ReviewPublic

Authored by ahmadosama on May 2 2019, 11:42 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Checking similar JS Engine like the QJSEngine the QJSValue has a function that allows calling the javascript function, but this behavior is not supported by KJS.

I created this patch as I applied for GSoC this year with Okular to the project: Support animated pdf

A sample of the javascript code we need to run could be found here: LINK

So we need to support setInterval which can be done by using QTimer and when timeout signal is emitted we could call the required function.

Diff Detail

Repository
R314 KJs
Branch
add_call_to_kjobject_api (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11442
Build 11460: arc lint + arc unit
ahmadosama created this revision.May 2 2019, 11:42 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 2 2019, 11:42 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ahmadosama requested review of this revision.May 2 2019, 11:42 AM
ahmadosama retitled this revision from Allow calling function from KJObject by adding a call function to its api to [KJS] Allow calling function from KJObject by adding a call function to its api.May 2 2019, 11:43 AM
apol added a subscriber: apol.May 2 2019, 11:49 AM

What are you using KJs for that needs such changes?

src/kjs/api/kjsobject.cpp
225

Just KJS::List args;

src/kjs/api/kjsobject.h
150

Just pass a default argument = {} and the method doesn't need to be overloaded.

ahmadosama retitled this revision from [KJS] Allow calling function from KJObject by adding a call function to its api to [KJS] Allow calling function from KJSObject by adding a call function to its api.May 2 2019, 11:50 AM
ahmadosama edited the summary of this revision. (Show Details)

@apol

I updated the the description of the patch now, sorry about that.

ahmadosama updated this revision to Diff 57376.May 2 2019, 12:15 PM
  • Passing default empty paramters to the call function
ahmadosama edited the summary of this revision. (Show Details)May 2 2019, 12:20 PM
ahmadosama added a subscriber: aacid.