seven332 / quickjs-android

QuickJS Android wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create function without specify parameters, any idea?

HarlonWang opened this issue · comments

Create function use quickjs-android must be specify parameters:

JSFunction zeroCompareTo = context.createJSFunction(integer, Method.create(Integer.class, Integer.class.getMethod("compareTo", Integer.class)));

Hopes like this:

	context.createJSFunction("setTimeout", new Callback() {
		public JSValue callFunction(JSValue[] args) {
			//handle some thing
			JSValue firstArg = args[0];
			if( firstArg instanceOf JSString) {
				Log.d("Test", fristArg);
			}

			return null;
		} 
	})

Any idea , thx

have the same problem. how to solve it?

Wow, it's should be supported. I will work on it this weekend.

@seven332 Great job ! :)