Files
kotlin-fork/js/js.translator/testFiles/kotlinLib/cases/namespaceWithClasses.js
T
2013-09-17 21:55:13 +04:00

59 lines
1.7 KiB
JavaScript

/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
var items = function () {
var A = Kotlin.createClass(null,
function $fun() {
this.$order = '';
{
this.set_order(this.get_order() + 'A');
}
},
{
set_order: function (tmp$0) {
this.$order = tmp$0;
},
get_order: function () {
return this.$order;
}
});
var B = Kotlin.createClass(A, function $fun() {
$fun.baseInitializer.call(this);
{
this.set_order(this.get_order() + 'B');
}
});
var C = Kotlin.createClass(B, function $fun() {
$fun.baseInitializer.call(this);
{
this.set_order(this.get_order() + 'C');
}
});
return {A: A, B: B, C: C};
}();
items.box = function () {
return (new foo.C).get_order() === 'ABC' && (new foo.B).get_order() === 'AB' && (new foo.A).get_order() === 'A';
};
var foo = Kotlin.defineRootPackage(null, items);
}
function test() {
return foo.box()
}