TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
EvalJS lets you run JavaScript code from your iOS app. It is based on JavaScriptCore and Ejecta, but does not contain any DOM or Canvas/Audio objects.
Experimental. This has not been used in production yet and should be considered as a proof of concept.
EvalJS* js = [[EvalJS alloc] init];
[js eval:@"function test(a, b) {return a + b; }"];
id result = [js eval:@"test(3, 2)"];
NSLog(@"result: %@", result);
EvalJS* js = [[EvalJS alloc] init];
[js createFunction:@"hello" callback:^id(NSUInteger argc, NSArray *argv) {
NSLog(@"hello: %@", [argv objectAtIndex:0]);
return @"world";
}];
NSString* result = [js eval:@"hello(3)"];
The output would be:
hello: 3
Copyright (c) 2013 Francis Chong [email protected].
Released under the MIT license. See LICENSE for details.