Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
renderjs
Commits
5620d6c9
Commit
5620d6c9
authored
Jul 23, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
declareMethod is callable on the class.
parent
275c38f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
test/renderjs_test2.js
test/renderjs_test2.js
+10
-6
No files found.
test/renderjs_test2.js
View file @
5620d6c9
...
@@ -940,7 +940,7 @@
...
@@ -940,7 +940,7 @@
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// RenderJSGadget.declareMethod
// RenderJSGadget.declareMethod
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
module
(
"
RenderJSGadget.declareMethod
"
);
module
(
"
RenderJSGadget
Klass
.declareMethod
"
);
test
(
'
is chainable
'
,
function
()
{
test
(
'
is chainable
'
,
function
()
{
// Check that declareMethod is chainable
// Check that declareMethod is chainable
...
@@ -950,14 +950,15 @@
...
@@ -950,14 +950,15 @@
},
gadget
,
result
;
},
gadget
,
result
;
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
declareMethod
=
RenderJSGadget
.
declareMethod
;
gadget
=
new
Klass
();
gadget
=
new
Klass
();
equal
(
gadget
.
testFoo
,
undefined
);
equal
(
gadget
.
testFoo
,
undefined
);
result
=
gadget
.
declareMethod
(
'
testFoo
'
,
function
()
{
result
=
Klass
.
declareMethod
(
'
testFoo
'
,
function
()
{
var
a
;
var
a
;
});
});
// declareMethod is chainable
// declareMethod is chainable
equal
(
result
,
gadget
);
equal
(
result
,
Klass
);
});
});
test
(
'
creates methods on the prototype
'
,
function
()
{
test
(
'
creates methods on the prototype
'
,
function
()
{
...
@@ -969,10 +970,11 @@
...
@@ -969,10 +970,11 @@
},
gadget
,
called
,
result
;
},
gadget
,
called
,
result
;
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
declareMethod
=
RenderJSGadget
.
declareMethod
;
gadget
=
new
Klass
();
gadget
=
new
Klass
();
equal
(
gadget
.
testFoo
,
undefined
);
equal
(
gadget
.
testFoo
,
undefined
);
gadget
.
declareMethod
(
'
testFoo
'
,
function
(
value
)
{
Klass
.
declareMethod
(
'
testFoo
'
,
function
(
value
)
{
called
=
value
;
called
=
value
;
});
});
// Method is added on the instance class prototype
// Method is added on the instance class prototype
...
@@ -996,9 +998,10 @@
...
@@ -996,9 +998,10 @@
},
gadget
;
},
gadget
;
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
declareMethod
=
RenderJSGadget
.
declareMethod
;
gadget
=
new
Klass
();
gadget
=
new
Klass
();
gadget
.
declareMethod
(
'
testFoo
'
,
function
(
value
)
{
Klass
.
declareMethod
(
'
testFoo
'
,
function
(
value
)
{
return
value
;
return
value
;
});
});
...
@@ -1025,9 +1028,10 @@
...
@@ -1025,9 +1028,10 @@
},
gadget
;
},
gadget
;
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
=
new
RenderJSGadget
();
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
prototype
.
constructor
=
Klass
;
Klass
.
declareMethod
=
RenderJSGadget
.
declareMethod
;
gadget
=
new
Klass
();
gadget
=
new
Klass
();
gadget
.
declareMethod
(
'
testFoo
'
,
function
(
value
)
{
Klass
.
declareMethod
(
'
testFoo
'
,
function
(
value
)
{
var
dfr
=
$
.
Deferred
();
var
dfr
=
$
.
Deferred
();
setTimeout
(
function
()
{
setTimeout
(
function
()
{
dfr
.
reject
(
value
);
dfr
.
reject
(
value
);
...
...
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