New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIMOB-9874: BlackBerry: implement require() #96
TIMOB-9874: BlackBerry: implement require() #96
Conversation
[Issues Fixed] TIMOB-9874: BlackBerry: implement require() [Changes] NativeLoggerWorker.cpp - add newline to message first so the stream doesn't split it up TiRootObject.cpp - function executeScript - use variables for the bootstrap and app filenames - pass the filenames to the calls to Compile() - add the javascript filename and line number to the log message - implement function _require TiTitaniumObject.cpp - function _include - add the javascript filename and line number to the log message [Tests] Test 1: Build and run an app (using .js files from Jira) 1) Put the .js files in the Resources dir so they will get packaged 2) Build, package, and run the app 3) Verify the correct info is shown in the app 4) Close the app, get the log, and verify the "module being loaded!" message is only shown once Test 2: Crash the app 1) Put an undeclared variable in app.js, a file being included, and a file being required 2) Run the app, verify it crashes, get the log, and verify the location of the problem is shown 3) Remove the offending variable 4) Repeat Steps 2-3 until all offending variables are gone and the app runs successfully
String::Utf8Value error(tryCatch.Exception()); | ||
TiLogger::getInstance().log(*error); | ||
Local<Value> exception = tryCatch.Exception(); | ||
if (exception->IsString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that something, that could happen? I don't think it could be string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put a FIXME to handle this better
Are we able to load module with its ID? If not please add todo for that. |
Update apidoc, since it says NYI for BlackBerry |
Reviewed |
For the ID, isn't that just the filename without the ".js"? If not then that would be something we'd need to investigate more. |
updated require() documentation put module error string in central location check if Message() is empty replace exception->IsString() hack with FIXME rename v8Id to be more representative add space in include() error string
Updated apidoc |
Updated patch |
For the ID I meant the native modules referenced with say com.macadamian.module1. Please add todo, so we can track it later. |
Approved with comment |
@@ -180,7 +180,8 @@ methods: | |||
require ('/myModule/module.js') | |||
|
|||
#### BlackBerry | |||
NYI | |||
|
|||
Currently, only base paths are valid. Relative paths are NYI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you created a JIRA task to track that NYI stuff? I can't see it from the commit description.
Approved with comment |
added id support to TODO
Conflicts: blackberry/tibb/TiMessageStrings.h
@alexandergalstyan I've added a TODO |
TIMOB-9874: BlackBerry: implement require() [Issues Fixed] TIMOB-9874: BlackBerry: implement require() [Changes] NativeLoggerWorker.cpp - add newline to message first so the stream doesn't split it up TiRootObject.cpp - function executeScript - use variables for the bootstrap and app filenames - pass the filenames to the calls to Compile() - add the javascript filename and line number to the log message - implement function _require TiTitaniumObject.cpp - function _include - add the javascript filename and line number to the log message [Tests] Test 1: Build and run an app (using .js files from Jira) 1) Put the .js files in the Resources dir so they will get packaged 2) Build, package, and run the app 3) Verify the correct info is shown in the app 4) Close the app, get the log, and verify the "module being loaded!" message is only shown once Test 2: Crash the app 1) Put an undeclared variable in app.js, a file being included, and a file being required 2) Run the app, verify it crashes, get the log, and verify the location of the problem is shown 3) Remove the offending variable 4) Repeat Steps 2-3 until all offending variables are gone and the app runs successfully
Created Jiras: |
Reviewers: Alex, Harut