Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/170776

Change subject: Use mw.template.compile for compiling
......................................................................

Use mw.template.compile for compiling

Update tests to avoid deprecation warnings

Change-Id: Ic3ed72ae1ee3393b6eddf8ce2e3bef24d2913e71
---
M tests/javascripts/common/test_View.js
M tests/javascripts/common/test_templates.js
2 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Mantle 
refs/changes/76/170776/1

diff --git a/tests/javascripts/common/test_View.js 
b/tests/javascripts/common/test_View.js
index f9e9c73..c14d796 100644
--- a/tests/javascripts/common/test_View.js
+++ b/tests/javascripts/common/test_View.js
@@ -20,7 +20,7 @@
                        }
                };
                // Register template compiler
-               M.template.registerCompiler( 'xyz', compiler );
+               mw.template.registerCompiler( 'xyz', compiler );
        }
 } );
 
@@ -69,7 +69,7 @@
        var ChildView, view;
        ChildView = View.extend( {
                className: 'my-class',
-               template: M.template.compile( 
'<h1>{{title}}</h1><p>{{content}}</p>', 'xyz' ),
+               template: mw.template.compile( 
'<h1>{{title}}</h1><p>{{content}}</p>', 'xyz' ),
                title: function() {
                        return this.$( 'h1' ).text();
                },
@@ -89,12 +89,12 @@
        var ParentView, ChildView, view;
 
        ParentView = View.extend( {
-               template: M.template.compile( '<h1>{{title}}</h1>{{>content}}', 
'xyz' )
+               template: mw.template.compile( 
'<h1>{{title}}</h1>{{>content}}', 'xyz' )
        } );
 
        ChildView = ParentView.extend( {
                templatePartials: {
-                       content: M.template.compile( '<p>{{text}}</p>', 'xyz' )
+                       content: mw.template.compile( '<p>{{text}}</p>', 'xyz' )
                }
        } );
 
@@ -148,7 +148,7 @@
 QUnit.test( 'View#preRender', 1, function( assert ) {
        var ChildView, view;
        ChildView = View.extend( {
-               template: M.template.compile( '<p>{{text}}</p>', 'xyz' ),
+               template: mw.template.compile( '<p>{{text}}</p>', 'xyz' ),
                preRender: function( options ) {
                        options.text = 'hello';
                }
diff --git a/tests/javascripts/common/test_templates.js 
b/tests/javascripts/common/test_templates.js
index e46e26c..7aa1341 100644
--- a/tests/javascripts/common/test_templates.js
+++ b/tests/javascripts/common/test_templates.js
@@ -24,7 +24,7 @@
                        M.template.add( 'test_templates_foo', 'hello' );
                }, 'When no prefix throw exception.' );
        assert.throws( function() {
-                       M.template.compile( '{{foo}}', 'rainbow' );
+                       mw.template.compile( '{{foo}}', 'rainbow' );
                }, 'Unknown compiler names throw exceptions.' );
        assert.strictEqual( M.template.get( 'test_templates_foo.xyz' ), 'xyz 
compiler' );
        assert.strictEqual( M.template.get( 'test_templates_foo.abc' ), 'abc 
default compiler' );

-- 
To view, visit https://gerrit.wikimedia.org/r/170776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3ed72ae1ee3393b6eddf8ce2e3bef24d2913e71
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Mantle
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to