Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
didier
2016-05-18 14:00:17 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
548688a6255f46c3a412d5a1c3fe9d5aca406e4e
548688a6
1 parent
3cd8206f
work on engine readability
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
src/arcs_module.js
src/context.js
src/arcs_module.js
View file @
548688a
...
...
@@ -66,7 +66,7 @@ arcs_module = function(moduleDefinition, deps) {
// shim performed
require
([
dep
],
function
(
d
)
{
resolve
(
d
);
},
function
(
err
)
{
reject
(
dep
,
err
);
}
function
(
err
)
{
console
.
log
(
"[ARCS] Trouble with module "
,
dep
);
reject
(
dep
,
err
);
}
);
}
});
...
...
src/context.js
View file @
548688a
...
...
@@ -120,16 +120,18 @@ ARCS.Context = function( ctx ) {
var
p
,
promises
=
[];
for
(
p
in
components
)
{
if
(
components
.
hasOwnProperty
(
p
))
{
if
(
components
.
hasOwnProperty
(
p
))
{
if
(
factories
[
components
[
p
].
type
]
===
undefined
)
{
console
.
error
(
"[ARCS] Factory "
+
components
[
p
].
type
+
" not found."
);
console
.
error
(
"[ARCS] Context dump follows: "
,
libraries
,
components
,
constants
);
return
;
}
factory
=
factories
[
components
[
p
].
type
];
try
{
if
(
components
[
p
].
value
!==
undefined
||
components
[
p
].
url
!==
undefined
||
components
[
p
].
ref
!==
undefined
)
{
if
(
components
[
p
].
value
!==
undefined
)
{
console
.
log
(
"instanciating "
,
p
);
components
[
p
].
instance
=
new
factory
(
components
[
p
].
value
);
}
if
(
components
[
p
].
url
!==
undefined
)
{
...
...
@@ -147,6 +149,7 @@ ARCS.Context = function( ctx ) {
}
else
{
components
[
p
].
instance
=
new
factory
();
}
}
catch
(
e
)
{
console
.
error
(
"[ARCS] Component of type "
,
p
,
" not instanciated."
,
e
);}
}
}
return
Promise
.
all
(
promises
);
...
...
Please
register
or
login
to post a comment