Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
yjs
Commits
d1059b5d
Commit
d1059b5d
authored
8 years ago
by
Kevin Jahns
Browse files
Options
Downloads
Patches
Plain Diff
local sourceDir causes troubles if modules are required by a yjs instance
parent
8b24284e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/y.js
+6
-3
6 additions, 3 deletions
src/y.js
with
6 additions
and
3 deletions
src/y.js
+
6
−
3
View file @
d1059b5d
...
...
@@ -37,8 +37,8 @@ Y.extend = function (name, value) {
}
Y
.
requestModules
=
requestModules
function
requestModules
(
modules
,
sourceDir
)
{
sourceDir
=
sourceDir
||
'
/bower_components
'
function
requestModules
(
modules
)
{
var
sourceDir
=
Y
.
sourceDir
||
'
/bower_components
'
// determine if this module was compiled for es5 or es6 (y.js vs. y.es6)
// if Insert.execute is a Function, then it isnt a generator..
// then load the es5(.js) files..
...
...
@@ -103,6 +103,9 @@ type YOptions = {
*/
function
Y
(
opts
/* :YOptions */
)
/* :Promise<YConfig> */
{
if
(
opts
.
sourceDir
!=
null
)
{
Y
.
sourceDir
=
opts
.
sourceDir
}
opts
.
types
=
opts
.
types
!=
null
?
opts
.
types
:
[]
var
modules
=
[
opts
.
db
.
name
,
opts
.
connector
.
name
].
concat
(
opts
.
types
)
for
(
var
name
in
opts
.
share
)
{
...
...
@@ -110,7 +113,7 @@ function Y (opts/* :YOptions */) /* :Promise<YConfig> */ {
}
return
new
Promise
(
function
(
resolve
,
reject
)
{
setTimeout
(
function
()
{
Y
.
requestModules
(
modules
,
opts
.
sourceDir
).
then
(
function
()
{
Y
.
requestModules
(
modules
).
then
(
function
()
{
if
(
opts
==
null
)
reject
(
'
An options object is expected!
'
)
else
if
(
opts
.
connector
==
null
)
reject
(
'
You must specify a connector! (missing connector property)
'
)
else
if
(
opts
.
connector
.
name
==
null
)
reject
(
'
You must specify connector name! (missing connector.name property)
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment