projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Node JS Addon for DALi + Improvements
[platform/core/uifw/dali-toolkit.git]
/
plugins
/
dali-script-v8
/
src
/
module-loader
/
module-loader.cpp
diff --git
a/plugins/dali-script-v8/src/module-loader/module-loader.cpp
b/plugins/dali-script-v8/src/module-loader/module-loader.cpp
index
c9d58ea
..
12ad13c
100644
(file)
--- a/
plugins/dali-script-v8/src/module-loader/module-loader.cpp
+++ b/
plugins/dali-script-v8/src/module-loader/module-loader.cpp
@@
-29,7
+29,6
@@
namespace V8Plugin
ModuleLoader::ModuleLoader()
{
ModuleLoader::ModuleLoader()
{
-
}
ModuleLoader::~ModuleLoader()
}
ModuleLoader::~ModuleLoader()
@@
-97,6
+96,11
@@
bool ModuleLoader::ExecuteScriptFromFile( v8::Isolate* isolate,
V8Utils::GetFileContents( fileName, contents );
V8Utils::GetFileContents( fileName, contents );
+ if( contents.empty() )
+ {
+ return false;
+ }
+
return ExecuteScript( isolate, contents, fileName );
}
return ExecuteScript( isolate, contents, fileName );
}
@@
-170,11
+174,11
@@
bool ModuleLoader::ExecuteScriptFromFile( v8::Isolate* isolate,
*
*
* // ImageActor.js
*
*
* // ImageActor.js
- * function ImageActor( position,
ro
tation, image, name )
+ * function ImageActor( position,
orien
tation, image, name )
* {
* this = new dali.ImageActor( image );
* this.position = position;
* {
* this = new dali.ImageActor( image );
* this.position = position;
- * this.
rotation = ro
tation;
+ * this.
orientation = orien
tation;
* this.name = name;
* }
* module.exports = ImageActor;
* this.name = name;
* }
* module.exports = ImageActor;
@@
-185,7
+189,7
@@
bool ModuleLoader::ExecuteScriptFromFile( v8::Isolate* isolate,
*
* var ImageActor = require(" ImageActor.js");
*
*
* var ImageActor = require(" ImageActor.js");
*
- * var imageActor = new ImageActor( position,
ro
tation, image, "my first image actor");
+ * var imageActor = new ImageActor( position,
orien
tation, image, "my first image actor");
*
* #### Exporting as a singleton
*
*
* #### Exporting as a singleton
*
@@
-306,9
+310,7
@@
bool ModuleLoader::ExecuteScriptFromFile( v8::Isolate* isolate,
* @for ModuleLoader
*
*/
* @for ModuleLoader
*
*/
-void ModuleLoader::Require(const v8::FunctionCallbackInfo< v8::Value >& args,
-
- v8::Persistent<v8::ObjectTemplate>& globalObjectTemplate )
+void ModuleLoader::Require(const v8::FunctionCallbackInfo< v8::Value >& args )
{
v8::Isolate* isolate = args.GetIsolate();
v8::HandleScope handleScope( isolate );
{
v8::Isolate* isolate = args.GetIsolate();
v8::HandleScope handleScope( isolate );
@@
-388,6
+390,12
@@
void ModuleLoader::Require(const v8::FunctionCallbackInfo< v8::Value >& args,
args.GetReturnValue().Set( moduleExports );
}
args.GetReturnValue().Set( moduleExports );
}
+
+void ModuleLoader::StorePreBuiltModule( v8::Isolate* isolate, v8::Local<v8::Object>& exportObject, const std::string& name )
+{
+ StoreModule( "", name, name, isolate, exportObject );
+}
+
void ModuleLoader::StoreScriptInfo( const std::string& sourceFileName )
{
V8Utils::GetFileDirectory( sourceFileName, mCurrentScriptPath);
void ModuleLoader::StoreScriptInfo( const std::string& sourceFileName )
{
V8Utils::GetFileDirectory( sourceFileName, mCurrentScriptPath);