Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
renderjs
Commits
689c76ae
Commit
689c76ae
authored
Dec 04, 2014
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure iframe methods return RSVP.Queue.
parent
f510b4c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
renderjs.js
renderjs.js
+18
-14
test/renderjs_test.js
test/renderjs_test.js
+9
-0
No files found.
renderjs.js
View file @
689c76ae
...
...
@@ -505,21 +505,25 @@
gadget_instance
.
__chan
.
bind
(
"
declareMethod
"
,
function
(
trans
,
method_name
)
{
gadget_instance
[
method_name
]
=
function
()
{
var
argument_list
=
arguments
;
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
gadget_instance
.
__chan
.
call
({
method
:
"
methodCall
"
,
params
:
[
method_name
,
Array
.
prototype
.
slice
.
call
(
argument_list
,
0
)],
success
:
function
(
s
)
{
resolve
(
s
);
},
error
:
function
(
e
)
{
reject
(
e
);
}
var
argument_list
=
arguments
,
wait_promise
=
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
gadget_instance
.
__chan
.
call
({
method
:
"
methodCall
"
,
params
:
[
method_name
,
Array
.
prototype
.
slice
.
call
(
argument_list
,
0
)],
success
:
function
(
s
)
{
resolve
(
s
);
},
error
:
function
(
e
)
{
reject
(
e
);
}
});
});
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
wait_promise
;
});
});
};
return
"
OK
"
;
});
...
...
test/renderjs_test.js
View file @
689c76ae
...
...
@@ -3248,6 +3248,15 @@
.
then
(
function
(
new_gadget
)
{
return
new
RSVP
.
Queue
()
// Method returns an RSVP.Queue
.
push
(
function
()
{
var
result
=
new_gadget
.
wasReadyCalled
();
ok
(
result
instanceof
RSVP
.
Queue
,
"
iframe method should return Queue
"
);
})
// Check that ready function are called
.
push
(
function
()
{
return
new_gadget
.
wasReadyCalled
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment