├── .gitignore ├── JSCoreTest.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── evgenyneu.xcuserdatad │ └── xcschemes │ ├── JSCoreTest.xcscheme │ └── xcschememanagement.plist ├── JSCoreTest ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── JSCoreTest-Info.plist ├── JSCoreTest-Prefix.pch ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings ├── greet.js └── main.m ├── JSCoreTestTests ├── JSCoreTestTests-Info.plist ├── JSCoreTestTests.m └── en.lproj │ └── InfoPlist.strings ├── README.md └── javascriptcore_demo_ios.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ -------------------------------------------------------------------------------- /JSCoreTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2B8150F41826568D00A87F77 /* greet.js in Resources */ = {isa = PBXBuildFile; fileRef = 2BA0ECD2182653000080FBF5 /* greet.js */; }; 11 | 2BA0EC9E18263ADC0080FBF5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BA0EC9D18263ADC0080FBF5 /* Foundation.framework */; }; 12 | 2BA0ECA018263ADC0080FBF5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BA0EC9F18263ADC0080FBF5 /* CoreGraphics.framework */; }; 13 | 2BA0ECA218263ADC0080FBF5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BA0ECA118263ADC0080FBF5 /* UIKit.framework */; }; 14 | 2BA0ECA818263ADC0080FBF5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2BA0ECA618263ADC0080FBF5 /* InfoPlist.strings */; }; 15 | 2BA0ECAA18263ADC0080FBF5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BA0ECA918263ADC0080FBF5 /* main.m */; }; 16 | 2BA0ECAE18263ADC0080FBF5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BA0ECAD18263ADC0080FBF5 /* AppDelegate.m */; }; 17 | 2BA0ECB118263ADC0080FBF5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2BA0ECAF18263ADC0080FBF5 /* Main.storyboard */; }; 18 | 2BA0ECB418263ADC0080FBF5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BA0ECB318263ADC0080FBF5 /* ViewController.m */; }; 19 | 2BA0ECB618263ADC0080FBF5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2BA0ECB518263ADC0080FBF5 /* Images.xcassets */; }; 20 | 2BA0ECBD18263ADC0080FBF5 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BA0ECBC18263ADC0080FBF5 /* XCTest.framework */; }; 21 | 2BA0ECBE18263ADC0080FBF5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BA0EC9D18263ADC0080FBF5 /* Foundation.framework */; }; 22 | 2BA0ECBF18263ADC0080FBF5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BA0ECA118263ADC0080FBF5 /* UIKit.framework */; }; 23 | 2BA0ECC718263ADC0080FBF5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2BA0ECC518263ADC0080FBF5 /* InfoPlist.strings */; }; 24 | 2BA0ECC918263ADC0080FBF5 /* JSCoreTestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BA0ECC818263ADC0080FBF5 /* JSCoreTestTests.m */; }; 25 | 2BA0ECD3182653000080FBF5 /* greet.js in Sources */ = {isa = PBXBuildFile; fileRef = 2BA0ECD2182653000080FBF5 /* greet.js */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 2BA0ECC018263ADC0080FBF5 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 2BA0EC9218263ADC0080FBF5 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 2BA0EC9918263ADC0080FBF5; 34 | remoteInfo = JSCoreTest; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 2BA0EC9A18263ADC0080FBF5 /* JSCoreTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JSCoreTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 2BA0EC9D18263ADC0080FBF5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 2BA0EC9F18263ADC0080FBF5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 2BA0ECA118263ADC0080FBF5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 2BA0ECA518263ADC0080FBF5 /* JSCoreTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JSCoreTest-Info.plist"; sourceTree = ""; }; 44 | 2BA0ECA718263ADC0080FBF5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 45 | 2BA0ECA918263ADC0080FBF5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 2BA0ECAB18263ADC0080FBF5 /* JSCoreTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JSCoreTest-Prefix.pch"; sourceTree = ""; }; 47 | 2BA0ECAC18263ADC0080FBF5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 2BA0ECAD18263ADC0080FBF5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 2BA0ECB018263ADC0080FBF5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 2BA0ECB218263ADC0080FBF5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 51 | 2BA0ECB318263ADC0080FBF5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 52 | 2BA0ECB518263ADC0080FBF5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 53 | 2BA0ECBB18263ADC0080FBF5 /* JSCoreTestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JSCoreTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 2BA0ECBC18263ADC0080FBF5 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 55 | 2BA0ECC418263ADC0080FBF5 /* JSCoreTestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JSCoreTestTests-Info.plist"; sourceTree = ""; }; 56 | 2BA0ECC618263ADC0080FBF5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | 2BA0ECC818263ADC0080FBF5 /* JSCoreTestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JSCoreTestTests.m; sourceTree = ""; }; 58 | 2BA0ECD2182653000080FBF5 /* greet.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = greet.js; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 2BA0EC9718263ADC0080FBF5 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 2BA0ECA018263ADC0080FBF5 /* CoreGraphics.framework in Frameworks */, 67 | 2BA0ECA218263ADC0080FBF5 /* UIKit.framework in Frameworks */, 68 | 2BA0EC9E18263ADC0080FBF5 /* Foundation.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 2BA0ECB818263ADC0080FBF5 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 2BA0ECBD18263ADC0080FBF5 /* XCTest.framework in Frameworks */, 77 | 2BA0ECBF18263ADC0080FBF5 /* UIKit.framework in Frameworks */, 78 | 2BA0ECBE18263ADC0080FBF5 /* Foundation.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 2BA0EC9118263ADC0080FBF5 = { 86 | isa = PBXGroup; 87 | children = ( 88 | 2BA0ECA318263ADC0080FBF5 /* JSCoreTest */, 89 | 2BA0ECC218263ADC0080FBF5 /* JSCoreTestTests */, 90 | 2BA0EC9C18263ADC0080FBF5 /* Frameworks */, 91 | 2BA0EC9B18263ADC0080FBF5 /* Products */, 92 | ); 93 | sourceTree = ""; 94 | }; 95 | 2BA0EC9B18263ADC0080FBF5 /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 2BA0EC9A18263ADC0080FBF5 /* JSCoreTest.app */, 99 | 2BA0ECBB18263ADC0080FBF5 /* JSCoreTestTests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 2BA0EC9C18263ADC0080FBF5 /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 2BA0EC9D18263ADC0080FBF5 /* Foundation.framework */, 108 | 2BA0EC9F18263ADC0080FBF5 /* CoreGraphics.framework */, 109 | 2BA0ECA118263ADC0080FBF5 /* UIKit.framework */, 110 | 2BA0ECBC18263ADC0080FBF5 /* XCTest.framework */, 111 | ); 112 | name = Frameworks; 113 | sourceTree = ""; 114 | }; 115 | 2BA0ECA318263ADC0080FBF5 /* JSCoreTest */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 2BA0ECAC18263ADC0080FBF5 /* AppDelegate.h */, 119 | 2BA0ECAD18263ADC0080FBF5 /* AppDelegate.m */, 120 | 2BA0ECAF18263ADC0080FBF5 /* Main.storyboard */, 121 | 2BA0ECB218263ADC0080FBF5 /* ViewController.h */, 122 | 2BA0ECB318263ADC0080FBF5 /* ViewController.m */, 123 | 2BA0ECB518263ADC0080FBF5 /* Images.xcassets */, 124 | 2BA0ECA418263ADC0080FBF5 /* Supporting Files */, 125 | 2BA0ECD2182653000080FBF5 /* greet.js */, 126 | ); 127 | path = JSCoreTest; 128 | sourceTree = ""; 129 | }; 130 | 2BA0ECA418263ADC0080FBF5 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 2BA0ECA518263ADC0080FBF5 /* JSCoreTest-Info.plist */, 134 | 2BA0ECA618263ADC0080FBF5 /* InfoPlist.strings */, 135 | 2BA0ECA918263ADC0080FBF5 /* main.m */, 136 | 2BA0ECAB18263ADC0080FBF5 /* JSCoreTest-Prefix.pch */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 2BA0ECC218263ADC0080FBF5 /* JSCoreTestTests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 2BA0ECC818263ADC0080FBF5 /* JSCoreTestTests.m */, 145 | 2BA0ECC318263ADC0080FBF5 /* Supporting Files */, 146 | ); 147 | path = JSCoreTestTests; 148 | sourceTree = ""; 149 | }; 150 | 2BA0ECC318263ADC0080FBF5 /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 2BA0ECC418263ADC0080FBF5 /* JSCoreTestTests-Info.plist */, 154 | 2BA0ECC518263ADC0080FBF5 /* InfoPlist.strings */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | /* End PBXGroup section */ 160 | 161 | /* Begin PBXNativeTarget section */ 162 | 2BA0EC9918263ADC0080FBF5 /* JSCoreTest */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = 2BA0ECCC18263ADC0080FBF5 /* Build configuration list for PBXNativeTarget "JSCoreTest" */; 165 | buildPhases = ( 166 | 2BA0EC9618263ADC0080FBF5 /* Sources */, 167 | 2BA0EC9718263ADC0080FBF5 /* Frameworks */, 168 | 2BA0EC9818263ADC0080FBF5 /* Resources */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | ); 174 | name = JSCoreTest; 175 | productName = JSCoreTest; 176 | productReference = 2BA0EC9A18263ADC0080FBF5 /* JSCoreTest.app */; 177 | productType = "com.apple.product-type.application"; 178 | }; 179 | 2BA0ECBA18263ADC0080FBF5 /* JSCoreTestTests */ = { 180 | isa = PBXNativeTarget; 181 | buildConfigurationList = 2BA0ECCF18263ADC0080FBF5 /* Build configuration list for PBXNativeTarget "JSCoreTestTests" */; 182 | buildPhases = ( 183 | 2BA0ECB718263ADC0080FBF5 /* Sources */, 184 | 2BA0ECB818263ADC0080FBF5 /* Frameworks */, 185 | 2BA0ECB918263ADC0080FBF5 /* Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | 2BA0ECC118263ADC0080FBF5 /* PBXTargetDependency */, 191 | ); 192 | name = JSCoreTestTests; 193 | productName = JSCoreTestTests; 194 | productReference = 2BA0ECBB18263ADC0080FBF5 /* JSCoreTestTests.xctest */; 195 | productType = "com.apple.product-type.bundle.unit-test"; 196 | }; 197 | /* End PBXNativeTarget section */ 198 | 199 | /* Begin PBXProject section */ 200 | 2BA0EC9218263ADC0080FBF5 /* Project object */ = { 201 | isa = PBXProject; 202 | attributes = { 203 | LastUpgradeCheck = 0500; 204 | ORGANIZATIONNAME = "Evgenii Neumerzhitckii"; 205 | TargetAttributes = { 206 | 2BA0ECBA18263ADC0080FBF5 = { 207 | TestTargetID = 2BA0EC9918263ADC0080FBF5; 208 | }; 209 | }; 210 | }; 211 | buildConfigurationList = 2BA0EC9518263ADC0080FBF5 /* Build configuration list for PBXProject "JSCoreTest" */; 212 | compatibilityVersion = "Xcode 3.2"; 213 | developmentRegion = English; 214 | hasScannedForEncodings = 0; 215 | knownRegions = ( 216 | en, 217 | Base, 218 | ); 219 | mainGroup = 2BA0EC9118263ADC0080FBF5; 220 | productRefGroup = 2BA0EC9B18263ADC0080FBF5 /* Products */; 221 | projectDirPath = ""; 222 | projectRoot = ""; 223 | targets = ( 224 | 2BA0EC9918263ADC0080FBF5 /* JSCoreTest */, 225 | 2BA0ECBA18263ADC0080FBF5 /* JSCoreTestTests */, 226 | ); 227 | }; 228 | /* End PBXProject section */ 229 | 230 | /* Begin PBXResourcesBuildPhase section */ 231 | 2BA0EC9818263ADC0080FBF5 /* Resources */ = { 232 | isa = PBXResourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | 2B8150F41826568D00A87F77 /* greet.js in Resources */, 236 | 2BA0ECB618263ADC0080FBF5 /* Images.xcassets in Resources */, 237 | 2BA0ECA818263ADC0080FBF5 /* InfoPlist.strings in Resources */, 238 | 2BA0ECB118263ADC0080FBF5 /* Main.storyboard in Resources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | 2BA0ECB918263ADC0080FBF5 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 2BA0ECC718263ADC0080FBF5 /* InfoPlist.strings in Resources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXSourcesBuildPhase section */ 253 | 2BA0EC9618263ADC0080FBF5 /* Sources */ = { 254 | isa = PBXSourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 2BA0ECB418263ADC0080FBF5 /* ViewController.m in Sources */, 258 | 2BA0ECAE18263ADC0080FBF5 /* AppDelegate.m in Sources */, 259 | 2BA0ECD3182653000080FBF5 /* greet.js in Sources */, 260 | 2BA0ECAA18263ADC0080FBF5 /* main.m in Sources */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | 2BA0ECB718263ADC0080FBF5 /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 2BA0ECC918263ADC0080FBF5 /* JSCoreTestTests.m in Sources */, 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | /* End PBXSourcesBuildPhase section */ 273 | 274 | /* Begin PBXTargetDependency section */ 275 | 2BA0ECC118263ADC0080FBF5 /* PBXTargetDependency */ = { 276 | isa = PBXTargetDependency; 277 | target = 2BA0EC9918263ADC0080FBF5 /* JSCoreTest */; 278 | targetProxy = 2BA0ECC018263ADC0080FBF5 /* PBXContainerItemProxy */; 279 | }; 280 | /* End PBXTargetDependency section */ 281 | 282 | /* Begin PBXVariantGroup section */ 283 | 2BA0ECA618263ADC0080FBF5 /* InfoPlist.strings */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | 2BA0ECA718263ADC0080FBF5 /* en */, 287 | ); 288 | name = InfoPlist.strings; 289 | sourceTree = ""; 290 | }; 291 | 2BA0ECAF18263ADC0080FBF5 /* Main.storyboard */ = { 292 | isa = PBXVariantGroup; 293 | children = ( 294 | 2BA0ECB018263ADC0080FBF5 /* Base */, 295 | ); 296 | name = Main.storyboard; 297 | sourceTree = ""; 298 | }; 299 | 2BA0ECC518263ADC0080FBF5 /* InfoPlist.strings */ = { 300 | isa = PBXVariantGroup; 301 | children = ( 302 | 2BA0ECC618263ADC0080FBF5 /* en */, 303 | ); 304 | name = InfoPlist.strings; 305 | sourceTree = ""; 306 | }; 307 | /* End PBXVariantGroup section */ 308 | 309 | /* Begin XCBuildConfiguration section */ 310 | 2BA0ECCA18263ADC0080FBF5 /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_CONSTANT_CONVERSION = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = NO; 329 | GCC_C_LANGUAGE_STANDARD = gnu99; 330 | GCC_DYNAMIC_NO_PIC = NO; 331 | GCC_OPTIMIZATION_LEVEL = 0; 332 | GCC_PREPROCESSOR_DEFINITIONS = ( 333 | "DEBUG=1", 334 | "$(inherited)", 335 | ); 336 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 340 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 341 | GCC_WARN_UNUSED_FUNCTION = YES; 342 | GCC_WARN_UNUSED_VARIABLE = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 344 | ONLY_ACTIVE_ARCH = YES; 345 | SDKROOT = iphoneos; 346 | }; 347 | name = Debug; 348 | }; 349 | 2BA0ECCB18263ADC0080FBF5 /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | ALWAYS_SEARCH_USER_PATHS = NO; 353 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 354 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 355 | CLANG_CXX_LIBRARY = "libc++"; 356 | CLANG_ENABLE_MODULES = YES; 357 | CLANG_ENABLE_OBJC_ARC = YES; 358 | CLANG_WARN_BOOL_CONVERSION = YES; 359 | CLANG_WARN_CONSTANT_CONVERSION = YES; 360 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 361 | CLANG_WARN_EMPTY_BODY = YES; 362 | CLANG_WARN_ENUM_CONVERSION = YES; 363 | CLANG_WARN_INT_CONVERSION = YES; 364 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 365 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 366 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 367 | COPY_PHASE_STRIP = YES; 368 | ENABLE_NS_ASSERTIONS = NO; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 371 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 372 | GCC_WARN_UNDECLARED_SELECTOR = YES; 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 374 | GCC_WARN_UNUSED_FUNCTION = YES; 375 | GCC_WARN_UNUSED_VARIABLE = YES; 376 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 377 | SDKROOT = iphoneos; 378 | VALIDATE_PRODUCT = YES; 379 | }; 380 | name = Release; 381 | }; 382 | 2BA0ECCD18263ADC0080FBF5 /* Debug */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 386 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 387 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 388 | GCC_PREFIX_HEADER = "JSCoreTest/JSCoreTest-Prefix.pch"; 389 | INFOPLIST_FILE = "JSCoreTest/JSCoreTest-Info.plist"; 390 | PRODUCT_NAME = "$(TARGET_NAME)"; 391 | WRAPPER_EXTENSION = app; 392 | }; 393 | name = Debug; 394 | }; 395 | 2BA0ECCE18263ADC0080FBF5 /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 399 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 400 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 401 | GCC_PREFIX_HEADER = "JSCoreTest/JSCoreTest-Prefix.pch"; 402 | INFOPLIST_FILE = "JSCoreTest/JSCoreTest-Info.plist"; 403 | PRODUCT_NAME = "$(TARGET_NAME)"; 404 | WRAPPER_EXTENSION = app; 405 | }; 406 | name = Release; 407 | }; 408 | 2BA0ECD018263ADC0080FBF5 /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 412 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JSCoreTest.app/JSCoreTest"; 413 | FRAMEWORK_SEARCH_PATHS = ( 414 | "$(SDKROOT)/Developer/Library/Frameworks", 415 | "$(inherited)", 416 | "$(DEVELOPER_FRAMEWORKS_DIR)", 417 | ); 418 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 419 | GCC_PREFIX_HEADER = "JSCoreTest/JSCoreTest-Prefix.pch"; 420 | GCC_PREPROCESSOR_DEFINITIONS = ( 421 | "DEBUG=1", 422 | "$(inherited)", 423 | ); 424 | INFOPLIST_FILE = "JSCoreTestTests/JSCoreTestTests-Info.plist"; 425 | PRODUCT_NAME = "$(TARGET_NAME)"; 426 | TEST_HOST = "$(BUNDLE_LOADER)"; 427 | WRAPPER_EXTENSION = xctest; 428 | }; 429 | name = Debug; 430 | }; 431 | 2BA0ECD118263ADC0080FBF5 /* Release */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 435 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JSCoreTest.app/JSCoreTest"; 436 | FRAMEWORK_SEARCH_PATHS = ( 437 | "$(SDKROOT)/Developer/Library/Frameworks", 438 | "$(inherited)", 439 | "$(DEVELOPER_FRAMEWORKS_DIR)", 440 | ); 441 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 442 | GCC_PREFIX_HEADER = "JSCoreTest/JSCoreTest-Prefix.pch"; 443 | INFOPLIST_FILE = "JSCoreTestTests/JSCoreTestTests-Info.plist"; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | TEST_HOST = "$(BUNDLE_LOADER)"; 446 | WRAPPER_EXTENSION = xctest; 447 | }; 448 | name = Release; 449 | }; 450 | /* End XCBuildConfiguration section */ 451 | 452 | /* Begin XCConfigurationList section */ 453 | 2BA0EC9518263ADC0080FBF5 /* Build configuration list for PBXProject "JSCoreTest" */ = { 454 | isa = XCConfigurationList; 455 | buildConfigurations = ( 456 | 2BA0ECCA18263ADC0080FBF5 /* Debug */, 457 | 2BA0ECCB18263ADC0080FBF5 /* Release */, 458 | ); 459 | defaultConfigurationIsVisible = 0; 460 | defaultConfigurationName = Release; 461 | }; 462 | 2BA0ECCC18263ADC0080FBF5 /* Build configuration list for PBXNativeTarget "JSCoreTest" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 2BA0ECCD18263ADC0080FBF5 /* Debug */, 466 | 2BA0ECCE18263ADC0080FBF5 /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | 2BA0ECCF18263ADC0080FBF5 /* Build configuration list for PBXNativeTarget "JSCoreTestTests" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | 2BA0ECD018263ADC0080FBF5 /* Debug */, 475 | 2BA0ECD118263ADC0080FBF5 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | /* End XCConfigurationList section */ 481 | }; 482 | rootObject = 2BA0EC9218263ADC0080FBF5 /* Project object */; 483 | } 484 | -------------------------------------------------------------------------------- /JSCoreTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JSCoreTest.xcodeproj/xcuserdata/evgenyneu.xcuserdatad/xcschemes/JSCoreTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /JSCoreTest.xcodeproj/xcuserdata/evgenyneu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JSCoreTest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 2BA0EC9918263ADC0080FBF5 16 | 17 | primary 18 | 19 | 20 | 2BA0ECBA18263ADC0080FBF5 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /JSCoreTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JSCoreTest 4 | // 5 | // Created by Evgenii Neumerzhitckii on 3/11/2013. 6 | // Copyright (c) 2013 Evgenii Neumerzhitckii. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JSCoreTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JSCoreTest 4 | // 5 | // Created by Evgenii Neumerzhitckii on 3/11/2013. 6 | // Copyright (c) 2013 Evgenii Neumerzhitckii. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /JSCoreTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 61 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /JSCoreTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /JSCoreTest/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /JSCoreTest/JSCoreTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | evgenyneu.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /JSCoreTest/JSCoreTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /JSCoreTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JSCoreTest 4 | // 5 | // Created by Evgenii Neumerzhitckii on 3/11/2013. 6 | // Copyright (c) 2013 Evgenii Neumerzhitckii. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JSCoreTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JSCoreTest 4 | // 5 | // Created by Evgenii Neumerzhitckii on 3/11/2013. 6 | // Copyright (c) 2013 Evgenii Neumerzhitckii. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UILabel *resultLabel; 15 | @property (weak, nonatomic) IBOutlet UITextView *javascriptText; 16 | @property (weak, nonatomic) IBOutlet UITextField *argumentText; 17 | 18 | @end 19 | 20 | @implementation ViewController 21 | 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | self.javascriptText.text = [self loadJsFromFile]; 27 | [self runJavaScript]; 28 | } 29 | 30 | - (NSString *)loadJsFromFile 31 | { 32 | NSString *path = [[NSBundle mainBundle] pathForResource:@"greet" ofType:@"js"]; 33 | NSString *jsScript = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; 34 | return jsScript; 35 | } 36 | 37 | - (void)runJavaScript 38 | { 39 | JSContext *context = [[JSContext alloc] init]; 40 | [context evaluateScript: self.javascriptText.text]; 41 | JSValue *function = context[@"greet"]; 42 | JSValue* result = [function callWithArguments:@[self.argumentText.text]]; 43 | self.resultLabel.text = [result toString]; 44 | } 45 | 46 | - (void)textViewDidChange:(UITextView *)textView 47 | { 48 | [self runJavaScript]; 49 | } 50 | 51 | - (IBAction)argumentValueEditingChanged:(id)sender { 52 | [self runJavaScript]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JSCoreTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /JSCoreTest/greet.js: -------------------------------------------------------------------------------- 1 | function greet(name) { 2 | return "Hello, " + name + "!"; 3 | } -------------------------------------------------------------------------------- /JSCoreTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JSCoreTest 4 | // 5 | // Created by Evgenii Neumerzhitckii on 3/11/2013. 6 | // Copyright (c) 2013 Evgenii Neumerzhitckii. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /JSCoreTestTests/JSCoreTestTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | evgenyneu.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /JSCoreTestTests/JSCoreTestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSCoreTestTests.m 3 | // JSCoreTestTests 4 | // 5 | // Created by Evgenii Neumerzhitckii on 3/11/2013. 6 | // Copyright (c) 2013 Evgenii Neumerzhitckii. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JSCoreTestTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JSCoreTestTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /JSCoreTestTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS JavaScriptCore demo 2 | 3 | This is a demo iOS app that shows how to run JavaScript function from Objective-C. If you are reading this you might also be interested in [JS evaluator for Android](https://github.com/evgenyneu/js-evaluator-for-android) library. 4 | 5 | ## Screenshot 6 | 7 | Demo: calling JavaScript function from Objective-C with JavaScriptCore framework in iOS. 8 | -------------------------------------------------------------------------------- /javascriptcore_demo_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evgenyneu/ios-javascriptcore-demo/b0f3938305ae011812844b05a487949273a96142/javascriptcore_demo_ios.png --------------------------------------------------------------------------------