Skip to content

Commit

Permalink
#161 Replace Hand-Made JS OO Code with default ES-Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkosertic committed Jun 21, 2019
1 parent 448d452 commit fe95696
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/test/resources/classtest.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
var jlObject = function() {

var C = function() {
this.property1 = 'Defaultvalue1';
};
C.STATICMEMBER = 10;
C.VOIDinit = function() {
Expand All @@ -43,6 +42,7 @@
C.prototype.clone = function() {
return this;
};
C.prototype.property1 = 'Defaultvalue1';

C.getName = function() {
return 'java.lang.Object';
Expand All @@ -57,8 +57,6 @@

var jlMath = function() {
var C = function() {
jlObject.prototype.constructor.call(this);
this.property2 = 'Defaultvalue2';
};
C.VOIDinit = function() {
jlObject.VOIDinit.call(this);
Expand All @@ -69,6 +67,7 @@
C.prototype.add = function(a, b) {
return a + b;
};
C.prototype.property2 = 'Defaultvalue2';

C.getName = function() {
return 'java.lang.Math';
Expand Down Expand Up @@ -97,6 +96,11 @@
console.log(obj.constructor.getName());
console.log(math.constructor.getName());
console.log(math);
console.log(obj.property1);
console.log(math.property1);
obj.property1 = 'Test';
console.log(obj.property1);
console.log(math.property1);
</script>
</body>
</html>

0 comments on commit fe95696

Please sign in to comment.