mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-28 12:46:45 +00:00
3d6391419d
Replacing them with static members on each node type Change-Id: I455debf880bef4e280eea072364f5f57308ec2b1
28 lines
532 B
JavaScript
28 lines
532 B
JavaScript
module( 've.Node' );
|
|
|
|
/* Stubs */
|
|
|
|
ve.NodeStub = function() {
|
|
// Inheritance
|
|
ve.Node.call( this, 'stub' );
|
|
};
|
|
|
|
ve.extendClass( ve.NodeStub, ve.Node );
|
|
|
|
/* Tests */
|
|
|
|
test( 'prototype.getType', 1, function() {
|
|
var node = new ve.NodeStub();
|
|
strictEqual( node.getType(), 'stub' );
|
|
} );
|
|
|
|
test( 'prototype.getParent', 1, function() {
|
|
var node = new ve.dm.NodeStub();
|
|
strictEqual( node.getParent(), null );
|
|
} );
|
|
|
|
test( 'prototype.getRoot', 1, function() {
|
|
var node = new ve.dm.NodeStub();
|
|
strictEqual( node.getRoot(), node );
|
|
} );
|