Socket
Socket
Sign inDemoInstall

es6-transpiler

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-transpiler - npm Package Compare versions

Comparing version 0.7.15 to 0.7.16-1

build/es5/transpiler/core/standardVars.js

1

build/build.js

@@ -80,2 +80,3 @@ "use strict";

, {file: 'transpiler/core/comments'}
, {file: 'transpiler/core/standardVars'}
, {folder: 'polyfills/test'}

@@ -82,0 +83,0 @@

2

build/es5/es6-transpiler.js

@@ -16,3 +16,3 @@ /*global require*/

var BUILD_VERSION = '0.7.15';
var BUILD_VERSION = '0.7.16-1';

@@ -19,0 +19,0 @@ var fs = require("fs");

@@ -169,3 +169,3 @@ /*global require:false*/

if ( !regExp_flag_u_support ) {
unescapeUnicode = _6918565771409574479198_1_require___lib_unescapeUnicode_js();
unescapeUnicode = _9317949501409922834637_1_require___lib_unescapeUnicode_js();

@@ -317,3 +317,3 @@ extendedRegExp["__polyfill__"] = function(convertUnicodeSequence_Map, codePointsRange_Map) {

};
var es6unicodeRangeConverter = _6918565771409574479198_2_require___lib_rangeRegenerate_js();
var es6unicodeRangeConverter = _9317949501409922834637_2_require___lib_rangeRegenerate_js();

@@ -368,3 +368,3 @@ var unicodeRange = function(str, code11, code12, char1, code21, code22, char2) {

_6918565771409574479198_3_require___String_fromCodePoint_js();
_9317949501409922834637_3_require___String_fromCodePoint_js();
var fromCodePoint = String["fromCodePoint"];

@@ -507,3 +507,3 @@ var charCodeToString = function(charCode) {

_6918565771409574479198_4_require___String__RE_methods_js()(global, $RegExp, updateGlobalRegExpProperties);
_9317949501409922834637_4_require___String__RE_methods_js()(global, $RegExp, updateGlobalRegExpProperties);
}

@@ -514,3 +514,3 @@ }

;function _6918565771409574479198_1_require___lib_unescapeUnicode_js(){var module = {exports: {}};/*global module:False*/
;function _9317949501409922834637_1_require___lib_unescapeUnicode_js(){var module = {exports: {}};/*global module:False*/
/*es6-transpiler symbols:false, has-iterators:false, has-generators: false,*/

@@ -543,3 +543,3 @@ // call require: from RegExp polyfill

;return module.exports};
;function _6918565771409574479198_2_require___lib_rangeRegenerate_js(){var module = {exports: {}};/*global module:false*/
;function _9317949501409922834637_2_require___lib_rangeRegenerate_js(){var module = {exports: {}};/*global module:false*/
/*es6-transpiler symbols:false, has-iterators:false, has-generators: false,*/

@@ -753,3 +753,3 @@ // call require: from RegExp polyfill

;return module.exports};
;function _6918565771409574479198_3_require___String_fromCodePoint_js(){var module = {exports: {}};/*global module:false*/
;function _9317949501409922834637_3_require___String_fromCodePoint_js(){var module = {exports: {}};/*global module:false*/
/*es6-transpiler symbols:false, has-iterators:false, has-generators: false*/

@@ -788,3 +788,3 @@ // call require: from RegExp polyfill

;return module.exports};
;function _6918565771409574479198_4_require___String__RE_methods_js(){var module = {exports: {}};/*global module*/
;function _9317949501409922834637_4_require___String__RE_methods_js(){var module = {exports: {}};/*global module*/
/*es6-transpiler symbols:false, has-iterators:false, has-generators: false*/

@@ -791,0 +791,0 @@ // call require: from RegExp polyfill

@@ -6,5 +6,12 @@ "use strict";

function isIdentifier(node) {
return node && node.type === "Identifier";
function isIdentifier(node, name) {
return node
&& node.type === "Identifier"
&& (!name || node.name == name)
;
}
function isMemberExpression(node) {
return node && node.type === "MemberExpression";
}
function isClass(node) {

@@ -14,43 +21,48 @@ return node && (node.type === "ClassDeclaration" || node.type === "ClassExpression")

var $defineProperty = "Object.defineProperty";
var objectMixinBody =
"function(t,s){"
+ "for(var p in s){"
+ "if(s.hasOwnProperty(p)){"
+ "${Object_defineProperty}(t,p,Object.getOwnPropertyDescriptor(s,p));"
+ "}"
+ "}"
+ "return t}"
;
function isHoistFunction(node) {
var type;
return node && (type = node.type)
&& (type === "FunctionDeclaration" || type === "FunctionExpression");
}
var classesTranspiler = {
reset: function() {
this.__currentClassMethodsStatic = null;
this.__currentClassName = null;
this.__superRefName = null;
this.__protoRefName = null;
this.__staticRefName = null;
this.__currentAccessors = null;
this.__currentStaticAccessors = null;
this.__currentFirstStaticAccessor = null;
function isLiteral(node) {
var type;
return node && (type = node.type)
&& (type === "Literal");
}
this.__staticPropertiesCount = 0;
this.__protoPropertiesCount = 0;
}
var GET_CNAMES = "function f(o){" +
"var r,u;for(var p in o)if((r=o[p])&&typeof r ==='object'&&(u=r[\"__unq\"])){" +
"${getCNames_names}[u]=p;" +
"delete r[\"__unq\"];" +
"}" +
"return o;" +
"};";
, createNames: function(node) {
// We need only one unique name for the entire file
function literalToName(string) {
var firstChar = string.charAt(0), lastChar = string.charAt(string.length - 1);
var isLiteral = (firstChar === '\'' || firstChar === '\"')
&& (lastChar === '\'' || lastChar === '\"')
;
if( !this.__superRefName ) {
this.__superRefName = core.unique("super", true);
}
if( !this.__protoRefName ) {
this.__protoRefName = core.unique("$proto", true);
}
if( !this.__staticRefName ) {
this.__staticRefName = core.unique("$static", true);
}
if ( isLiteral ) {
return string.substring(1, string.length - 1);
}
return string;
}
this.__DP = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
this.__MIXIN = core.bubbledVariableDeclaration(node.$scope, "MIXIN", objectMixinBody.replace("${Object_defineProperty}", this.__DP));
var classesTranspiler = {
reset: function() {
this.__statistic = {
staticCount: 0
, protoCount: 0
, flexibleNamesCount: 0
};
this.__current = {
method: null
, name: ''
, accessors: {}
, staticAccessors: {}
, firstStaticAccessors: null
};
}

@@ -64,31 +76,75 @@

core.registerVar('super', {persistent: true});
// core.registerVar('super_prototype', {persistent: true});
core.registerVar('static', {persistent: true});
core.registerVar('proto', {persistent: true});
core.registerVar('getCNames_names', {name: 'CNAMES', template: '[]'});
core.registerVar('getCNames', {name: 'GET_CNAMES', template: GET_CNAMES, deps: ['getCNames_names']});
this.alter = alter;
}
, createPrototypeString: function(node, className, superName, accessors) {
, accessorsDefinition: function(node, accessors) {
var accessorsKeys = Object.keys(accessors);
var accessorsFlexibleName = false;
var accessorsString = accessorsKeys.map(function(key) {
var accessor = accessors[key];
var raw = accessor.raw, getter = accessor.get, setter = accessor.set;
return (raw || key) + ": {" + (getter ? "\"get\": " + getter + ", " : "") + (setter ? "\"set\": " + setter + ", " : "") + "\"configurable\": true, \"enumerable\": true}"
} ).join(", ");
var result = {
objectWrapper: ''
, main: ''
, afterAll: ''
};
var Object_defineProperty_name = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
var freezePrototypeString = Object_defineProperty_name + "(" + className + ", \"prototype\", {\"configurable\": false, \"enumerable\": false, \"writable\": false});";
if ( accessorsKeys.length ) {
result.main = accessorsKeys.map(function(key) {
var accessor = accessors[key];
var raw = accessor.raw
, getter = accessor.get
, setter = accessor.set
, isFlexibleName = !!accessor.$nameForSuper
, uniqueId
;
if ( isFlexibleName ) {
accessorsFlexibleName = isFlexibleName;
uniqueId = ++this.__statistic.flexibleNamesCount;
var nameForSuper = accessor.$nameForSuper;
var namesVar = core.createVars(node, "getCNames_names");
result.afterAll += (nameForSuper + '=' + namesVar + '[' + uniqueId + '];delete ' + namesVar + '[' + uniqueId + '];');
}
return (raw || key)
+ ": {" + (getter ? "\"get\": " + getter + ", " : "") + (setter ? "\"set\": " + setter + ", " : "") + "\"configurable\":true,\"enumerable\":true"
+ (isFlexibleName ? ', "__unq": ' + uniqueId : '')
+ "}"
}, this).join(", ");
if ( accessorsFlexibleName ) {
result.objectWrapper = core.createVars(node, "getCNames");
}
}
return result;
}
, createPrototypeString: function(node, className, superName, accessors) {
var freezePrototypeString =
core.createVars(node, "defineProperty")
+ "(" + className + ",\"prototype\",{\"configurable\":false,\"enumerable\":false,\"writable\":false});";
if ( superName ) {
return className
+ ".prototype = Object.create(" + superName + ".prototype"
+ ", {"
+ "\"constructor\": {\"value\": " + className + ", \"configurable\": true, \"writable\": true}"
+ (accessorsString ? ", " + accessorsString : "")
+ " }"
+ ");"
var names = core.createVars(node, {setPrototypeOf: true/*, "super_prototype": true*/});
return "if(" + superName + "!==null)" + names.setPrototypeOf + "(" + className + "," + superName + ");"
+ className + ".prototype = "
+ this.createAccessorsDefinitionString(node, className, accessors, true, superName)
+ freezePrototypeString
;
}
else if ( accessorsString ) {
return "Object.defineProperties("
+ className + ".prototype, {" + accessorsString + "});"
else if ( Object.keys(accessors).length ) {
return this.createAccessorsDefinitionString(node, className + ".prototype", accessors)
+ freezePrototypeString

@@ -102,14 +158,33 @@ ;

, createStaticAccessorsDefinitionString: function(node, recipientStr, accessors) {
var accessorsKeys = Object.keys(accessors);
, createAccessorsDefinitionString: function(node, recipientStr, accessors, createMode, superName) {
var accessorsDefinition = this.accessorsDefinition(node, accessors);
if ( !accessorsKeys.length ) {
return "";
assert(!createMode || superName);
var accessorsString = accessorsDefinition.main;
if ( !accessorsString && !createMode ) {
return '';
}
var beforeObject = accessorsDefinition.objectWrapper ? accessorsDefinition.objectWrapper + '(' : '';
var afterObject = accessorsDefinition.objectWrapper ? ')' : '';
var afterAll = accessorsDefinition.afterAll ? accessorsDefinition.afterAll + ';' : '';
return ";Object.defineProperties(" + recipientStr + ", {" + accessorsKeys.map(function(key) {
var accessor = accessors[key];
var raw = accessor.raw, getter = accessor.get, setter = accessor.set;
return (raw || key) + ": {" + (getter ? "\"get\": " + getter + ", " : "") + (setter ? "\"set\": " + setter : "") + ", \"configurable\": true, \"enumerable\": true}"
} ).join(", ") + "});";
var funcName = core.createVars(node, createMode ? 'create' : 'defineProperties');
return funcName
+ "("
+ (createMode ? superName + "!==null?" + superName + ".prototype:null" : recipientStr)
+ ","
+ beforeObject
+ "{"
+ (createMode
? "\"constructor\":{\"value\":" + recipientStr + ",\"configurable\":true,\"writable\":true}"
+ (accessorsString ? ", " + accessorsString : "")
: accessorsString
)
+ "}"
+ afterObject
+ ");"
+ afterAll
;
}

@@ -119,4 +194,2 @@

{
this.createNames(node);
var isClassExpression = node.type === 'ClassExpression'

@@ -130,3 +203,2 @@ , nodeId = node.id

, currentClassName = nodeId ? nodeId.name : core.unique("constructor", true)
, SUPER_NAME = this.__superRefName
, useStrictString = node.strictMode ? "" : "\"use strict\";"

@@ -142,6 +214,6 @@ ;

var objectMixinFunctionName = this.__MIXIN;
var names = core.createVars(node, {"super": !!superClass, __proto__support: !!superClass, MIXIN: true});
node["$ClassName"] = currentClassName;
this.__currentClassName = currentClassName;
this.__current.name = currentClassName;

@@ -153,6 +225,7 @@ var classStr = (isClassExpression ? "(" : "var " + currentClassName + " = ")

if( superClass ) {
classStr += SUPER_NAME;
superClass = isIdentifier(superClass) ? superClass.name : this.alter.get(superClass.range[0], superClass.range[1]);
classStr += names.super;
insertAfterBodyBegin_string = objectMixinFunctionName + "(" + currentClassName + ", " + SUPER_NAME + ");";
insertAfterBodyBegin_string =
'if(!' + names.__proto__support + ')'
+ names.MIXIN + "(" + currentClassName + ", " + names.super + ");";
}

@@ -164,7 +237,14 @@

classConstructor = classBodyNodes[i];
if( classConstructor.type !== "MethodDefinition" ) {
classConstructor = null;
}
else if( classConstructor.key.name !== "constructor" ) {
classConstructor = null;
else {
var nodeKey = classConstructor.key;
var _isLiteral = isLiteral(nodeKey);
var methodName = _isLiteral ? nodeKey.value : nodeKey.name;
if( methodName !== "constructor" ) {
classConstructor = null;
}
}

@@ -177,12 +257,13 @@ }

this.__currentAccessors = {};
this.__currentStaticAccessors = {};
this.__current.accessors = {};
this.__current.staticAccessors = {};
if( classBodyNodesCount ) {
for ( var i$0 = 0 ; i$0 < classBodyNodesCount ; i$0++ ) {
this.replaceClassMethods(classBodyNodes[i$0], astQuery);
this.replaceClassMethods(this.__current.method = classBodyNodes[i$0], astQuery);
this.__current.method = null;
}
}
extendedClassConstructorPostfix = this.createPrototypeString(node, currentClassName, superClass && SUPER_NAME, this.__currentAccessors);
var staticAccessorsDefinitionString = this.createStaticAccessorsDefinitionString(node, currentClassName, this.__currentStaticAccessors);
extendedClassConstructorPostfix = this.createPrototypeString(node, currentClassName, superClass && names.super, this.__current.accessors);
var staticAccessorsDefinitionString = this.createAccessorsDefinitionString(node, currentClassName, this.__current.staticAccessors);

@@ -195,8 +276,10 @@ if( classConstructor ) {

astQuery.traverse(classConstructor, this.replaceClassConstructorSuper);
astQuery.traverse(classConstructor, this.replaceClassMethodSuperInConstructor);
this.__current.method = classConstructor.value;
astQuery.traverse(classConstructor.value.body, this.replaceClassConstructorSuper);
astQuery.traverse(classConstructor.value.body, this.replaceClassMethodSuperInConstructor);
this.__current.method = null;
}
else {
insertAfterBodyBegin_string = "function " + currentClassName + "() {"
+ (superClass ? SUPER_NAME + ".apply(this, arguments)" : "")
+ (superClass ? names.super + ".apply(this, arguments)" : "")
+ "}" + (insertAfterBodyBegin_string || "") + (extendedClassConstructorPostfix || "");

@@ -206,9 +289,15 @@ }

var theEndString = '', tmpVars = [];
if ( this.__staticPropertiesCount ) {
theEndString += (objectMixinFunctionName + '(' + currentClassName + ',' + this.__staticRefName + ');')
tmpVars.push(this.__staticRefName);
if ( this.__statistic.staticCount ) {
var staticName = core.createVars(node, "static");
theEndString += (names.MIXIN + '(' + currentClassName + ',' + staticName + ');')
tmpVars.push(staticName);
}
if ( this.__protoPropertiesCount ) {
theEndString += (objectMixinFunctionName + '(' + currentClassName + '.prototype,' + this.__protoRefName + ');')
tmpVars.push(this.__protoRefName);
if ( this.__statistic.protoCount ) {
var protoName = core.createVars(node, "proto");
theEndString += (names.MIXIN + '(' + currentClassName + '.prototype,' + protoName + ');')
tmpVars.push(protoName);
}

@@ -224,3 +313,3 @@ if ( tmpVars.length ) {

if ( staticAccessorsDefinitionString ) {
this.alter.insertAfter(this.__currentFirstStaticAccessor.range[1], staticAccessorsDefinitionString);
this.alter.insertAfter(this.__current.firstStaticAccessors.range[1], ';' + staticAccessorsDefinitionString);
}

@@ -234,24 +323,57 @@

this.alter.insert(node.range[1],
")(" + (superClass || "") + ")"
+ (isClassExpression ? ")" : ";")//tail ')' or semicolon
);
if ( superClass ) {
superClass = isIdentifier(superClass) ? superClass.name : this.alter.get(superClass.range[0], superClass.range[1]);
this.__currentClassName = null;
this.__staticPropertiesCount = 0;
this.__protoPropertiesCount = 0;
this.alter.insert(node.range[1],
")(" + superClass + ")"
+ (isClassExpression ? ")" : ";")//tail ')' or semicolon
);
}
else {
this.alter.insert(node.range[1],
")()" + (isClassExpression ? ")" : ";")//tail ')' or semicolon
);
}
this.reset();
}
}
, unwrapSuperCall: function unwrapSuperCall(node, calleeNode, isStatic, property, isConstructor) {
var superRefName = this.__superRefName;
assert(superRefName);
, unwrapSuperCall: function unwrapSuperCall(node, calleeNode, rootMethod, isConstructor) {
assert(!calleeNode.$originalName);
var changeStr = superRefName + (isStatic ? "" : ".prototype");
var superName = core.createVars(node, "super");
var isStatic = rootMethod.static;
var isAccessor = rootMethod.kind === 'get' || rootMethod.kind === 'set';
var changeStr = superName + (isStatic || isConstructor ? "" : ".prototype");
var callArguments = node.arguments;
var hasSpreadElement = !isStatic && callArguments.some(function(node){ return node.type === "SpreadElement" });
var hasSpreadElement = callArguments.some(function(node){ return node.type === "SpreadElement" });
var name = '', access = '';
if ( !isConstructor ) {
if ( name = rootMethod.$nameForSuper ) {
access = '[' + name + ']';
}
else {
name = core.PropertyToString(rootMethod.key, true);
}
}
if ( isAccessor ) {
changeStr = core.createVars(node, 'getOwnPropertyDescriptor')
+ '(' + changeStr + ',' + name + ')[\"' + rootMethod.kind + '\"]'
}
else {
if ( !isConstructor && !access && (!hasSpreadElement || !rootMethod.$__hasName) ) {
access = core.PropertyToString(rootMethod.key);
}
changeStr += access;
}
calleeNode.$originalName = calleeNode.name;
calleeNode.name = superName;
var changesEnd;
if( (!isStatic || isConstructor) && !hasSpreadElement ) {
changeStr += (property ? "." + property.name : "");
if( !hasSpreadElement ) {

@@ -266,9 +388,10 @@ if( !callArguments.length ) {

}
// text change 'super$0.call(this, <some>)'
this.alter.replace(calleeNode.range[0], changesEnd, changeStr);
}
else {
changesEnd = calleeNode.range[1];
// text change 'super(<some>)' => 'super$0(<some>)'
this.alter.replace(calleeNode.range[0], calleeNode.range[1], changeStr);
}
// text change 'super(<some>)' => 'super$0(<some>)' (if <some> contains SpreadElement) or 'super$0.call(this, <some>)'
this.alter.replace(calleeNode.range[0], changesEnd, changeStr);
}

@@ -280,7 +403,8 @@

if( calleeNode && isIdentifier(calleeNode) && calleeNode.name === "super" ) {
this.unwrapSuperCall(node, calleeNode, true, null, true);
if( calleeNode && isIdentifier(calleeNode) && calleeNode.name === 'super' ) {
this.unwrapSuperCall(node, calleeNode, this.__current.method, true);
}
}
else if( isClass(node) ) {
else if( isClass(node) || isHoistFunction(node) ) {
return false;

@@ -291,15 +415,61 @@ }

, replaceClassMethods: function replaceClassMethods(node, astQuery) {
if( node.type === "MethodDefinition" && node.key.name !== "constructor" ) {
var isStatic = this.__currentClassMethodsStatic = node.static;
var nodeKey = node.key;
var _isLiteral = isLiteral(nodeKey);
var methodName = core.PropertyToString(nodeKey, true);
if( node.type === "MethodDefinition" && (_isLiteral ? nodeKey.value : nodeKey.name) !== "constructor" ) {
var isStatic = node.static;
var isComputed = node.computed;
var nodeKey = node.key;
var keyRange = isComputed ? nodeKey.bracesRange : nodeKey.range;
if( node.kind === "set" || node.kind === "get" ) {
this.__namedSuperCount = 0;
this.__unNamedSuperCount = 0;
astQuery.traverse(node.value.body, function(child) {
if( child.type === "CallExpression" ) {
child = child.callee;
if( isMemberExpression(child) ) {
var objectNode = child.object;
if( isIdentifier(objectNode) && objectNode.name === 'super' ) {
this.__namedSuperCount++;
node.$hasSuperInside = true;
}
}
else if ( isIdentifier(child) && child.name === 'super' ) {
this.__unNamedSuperCount++;
node.$hasSuperInside = true;
}
}
else if( isClass(child) || isHoistFunction(child) ) {
return false;
}
}.bind(this));
var unNamedSuperCount = this.__unNamedSuperCount;
if( node.kind === 'set' || node.kind === 'get' ) {
if ( isComputed ) {
var targetName = isStatic === true ? this.__currentClassName : this.__currentClassName + '.prototype';
var targetName = isStatic === true ? this.__current.name : this.__current.name + '.prototype';
// get [<name>]() -> DP$0(<className>.prototype,<name>,
this.alter.replace(node.range[0], nodeKey.bracesRange[0] + 1, this.__DP + '(' + targetName + ',');
if ( unNamedSuperCount ) {
methodName = core.getScopeTempVar(node, node.$scope);
// get [<name>]() -> $D$0=(<name>]()
this.alter.replace(node.range[0], nodeKey.bracesRange[0] + 1, methodName + '=(');
// $D$0=(<name>]() -> $D$0=(<name>)+'';DP$0(<className>.prototype,$D$0,
this.alter.insert(
nodeKey.range[1]
, ')+\'\';' + core.createVars(node, 'defineProperty') + '(' + targetName + ',' + methodName
);
}
else {
// get [<name>]() -> DP$0(<className>.prototype,<name>,
this.alter.replace(
node.range[0]
, nodeKey.bracesRange[0] + 1
, core.createVars(node, 'defineProperty') + '(' + targetName + ','
);
}
this.alter.replace(nodeKey.range[1], nodeKey.bracesRange[1], ',{"' + node.kind + '":function');

@@ -310,27 +480,29 @@

}
else {// TODO:: make is easiest
if ( isStatic && !this.__currentFirstStaticAccessor ) {
this.__currentFirstStaticAccessor = node;
else {
if ( isStatic && !this.__current.firstStaticAccessors ) {
this.__current.firstStaticAccessors = node;
}
var isLiteral = nodeKey.type == 'Literal';
assert(isIdentifier(nodeKey) || isLiteral);
assert(isIdentifier(nodeKey) || _isLiteral);
var name;
if ( isLiteral ) {
name = nodeKey.value;
}
else {
name = nodeKey.name;
}
var key = literalToName(methodName);
var accessor = isStatic === true
? this.__currentStaticAccessors[name] || (this.__currentStaticAccessors[name] = {})
: this.__currentAccessors[name] || (this.__currentAccessors[name] = {})
? this.__current.staticAccessors[key] || (this.__current.staticAccessors[key] = {})
: this.__current.accessors[key] || (this.__current.accessors[key] = {})
;
var replacement = accessor[node.kind] = core.unique((isStatic ? "static_" : "") + name + "$" + node.kind, true);
accessor.node = node;
var replacement = accessor[node.kind] =
core.unique((isStatic ? "static_" : "") + key + "$" + node.kind, true)
;
if ( isLiteral ) {
if ( _isLiteral ) {
accessor.raw = nodeKey.raw;
}
else if ( node.$hasSuperInside ) {
if ( !accessor.$nameForSuper ) {
accessor.$nameForSuper = core.getScopeTempVar(node, node.$scope);
}
node.$nameForSuper = accessor.$nameForSuper;
}

@@ -343,19 +515,38 @@ this.alter.replace(node.range[0], nodeKey.range[1], "function " + replacement);

if ( isStatic ) {
this.__staticPropertiesCount++;
this.__statistic.staticCount++;
}
else {
this.__protoPropertiesCount++;
this.__statistic.protoCount++;
}
var targetName$0 = isStatic === true ? this.__staticRefName : this.__protoRefName;
var targetName$0 = core.createVars(node, isStatic === true ? 'static' : 'proto');
if ( isStatic ) {
// text change 'static method(<something>)' => '$static$0.method(<something>)'
// text change 'static [method](<something>)' => '$static$0[method](<something>)'
this.alter.replace(node.range[0], keyRange[0], targetName$0 + (isComputed ? '' : '.'));
if ( unNamedSuperCount && isComputed ) {
methodName = core.getScopeTempVar(node, node.$scope);
// text change 'static ['method' + i++](<something>)' => '$D$0=('method' + i++) + '';$static$0[$D$0](<something>)'
// text change '['method' + i++](<something>)' => '$D$0='method' + i++;$proto$0[$D$0](<something>)'
// [<name>]() -> $D$0=<name>]() or [<name>]() -> $D$0=(<name>]()
this.alter.replace(node.range[0], nodeKey.bracesRange[0] + 1, methodName + '=(');
// $D$0=(<name>]() -> $D$0=(<name>)+'';$proto$0[$D$0]()
this.alter.insertBefore(nodeKey.range[1], ')+\'\';' + targetName$0 + '[' + methodName);
}
else {
// text change 'method(<something>)' => '$proto$0.method(<something>)'
// text change '[method](<something>)' => '$proto$0[method](<something>)'
this.alter.insert(node.range[0], targetName$0 + (isComputed ? '' : '.'));
var beforeName = _isLiteral && !isComputed ? '[' : (isComputed ? '' : '.');
var afterName = _isLiteral && !isComputed ? ']' : '';
if ( isStatic ) {
// text change 'static method(<something>)' => '$static$0.method(<something>)'
// text change 'static [method](<something>)' => '$static$0[method](<something>)'
this.alter.replace(node.range[0], keyRange[0], targetName$0 + beforeName);
}
else {
// text change 'method(<something>)' => '$proto$0.method(<something>)'
// text change '[method](<something>)' => '$proto$0[method](<something>)'
this.alter.insert(node.range[0], targetName$0 + beforeName);
}
if ( afterName ) {
this.alter.insert(keyRange[1], afterName);
}
}

@@ -369,5 +560,5 @@

astQuery.traverse(node.value, this.replaceClassMethodSuper);
node.$nameForSuper = node.$nameForSuper/* || methodName*/;
astQuery.traverse(node.value.body, this.replaceClassMethodSuper);
}
this.__currentClassMethodsStatic = null;
}

@@ -377,15 +568,33 @@

if( node.type === "CallExpression" ) {
assert(typeof this.__currentClassMethodsStatic === "boolean");
var calleeNode = node.callee;
if( calleeNode && calleeNode.type === "MemberExpression" ) {
if( isMemberExpression(calleeNode) ) {
var objectNode = calleeNode.object;
if( objectNode && isIdentifier(objectNode) && objectNode.name === "super" ) {
if( isIdentifier(objectNode, 'super') ) {
// text change 'super.method(<some>)' => 'super$0(<some>)' (if <some> contains SpreadElement) or 'super$0.call(this, <some>)'
this.unwrapSuperCall(node, objectNode, this.__currentClassMethodsStatic, calleeNode.property);
this.unwrapSuperCall(node, objectNode, {
key: calleeNode.property
, $__hasName: true
, static: this.__current.method.static
, computed: this.__current.method.computed
});
return false;
}
}
else if ( isIdentifier(calleeNode, 'super') ) {
// text change 'super(<some>)' => 'super$0[<superMethodName>](<some>)' (if <some> contains SpreadElement) or 'super$0[<superMethodName>].call(this, <some>)'
this.unwrapSuperCall(node, calleeNode, this.__current.method);
}
}
else if( isClass(node) ) {
else if( isIdentifier(node, 'super') ) {
if ( !node.$originalName ) {
node.$originalName = node.name;
node.name = core.createVars(node, "super");
this.alter.replace(node.range[0], node.range[1], node.name);
}
}
else if( isClass(node) || isHoistFunction(node) ) {
return false;

@@ -396,3 +605,3 @@ }

, replaceClassMethodSuperInConstructor: function replaceClassMethodSuperInConstructor(node) {
if( isIdentifier(node) && node.name === "super" ) {
if( isIdentifier(node, 'super') ) {
var parent = node.$parent;

@@ -406,5 +615,5 @@ if ( parent.type === 'CallExpression' ) {

// text change 'super.a(<some>)' => 'super$0.a(<some>)'
this.alter.replace(node.range[0], node.range[1], this.__superRefName);
this.alter.replace(node.range[0], node.range[1], core.createVars(node, 'super'));
}
else if( isClass(node) ) {
else if( isClass(node) || isHoistFunction(node) ) {
return false;

@@ -411,0 +620,0 @@ }

@@ -12,2 +12,14 @@ /*globals require, module*/

function extend(target) {
for ( var i = 1, len = arguments.length ; i < len ; i++ ) {
var source = arguments[i];
for ( var key = void 0 in source ) if ( source.hasOwnProperty(key) ) {
target[key] = source[key];
}
}
return target;
}
function getline(node) {

@@ -65,2 +77,8 @@ return node.loc.start.line;

function isMethodDefinition(node) {
var type;
return node && (type = node.type)
&& (type === "MethodDefinition");
}
function isNonFunctionBlock(node) {

@@ -120,3 +138,3 @@ return node && node.type === "BlockStatement" && !isFunction(node.$parent);

var core = module.exports = {
var core = module.exports = extend({}, require('./core/standardVars.js'), {
reset: function() {

@@ -668,7 +686,14 @@ this.allIdentifiers = stringset();

, PropertyToString: function(node) {
var isParentComputedProperty = node && isProperty(node.$parentNode) && node.$parentNode.computed;
, PropertyToString: function(node, justName) {
var isParentComputedProperty = node
&& (isProperty(node.$parentNode) || isMethodDefinition(node.$parentNode))
&& node.$parentNode.computed
;
var _dot = justName ? '' : '.';
var _computedBefore = justName ? '' : '[';
var _computedAfter = justName ? '' : ']';
if ( isParentComputedProperty ) {
return "[" + this.alter.get(node.range[0], node.range[1]) + "]";
return _computedBefore + this.alter.get(node.range[0], node.range[1]) + _computedAfter;
}

@@ -681,6 +706,6 @@

if( node.type === "Literal" ) {
result = "[" + node.raw + "]";
result = _computedBefore + node.raw + _computedAfter;
}
else {
result = "." + node.name;
result = _dot + node.name;
}

@@ -690,2 +715,3 @@

}
core.__printNode(node)

@@ -1451,3 +1477,3 @@ assert(false);

}
};
});

@@ -1454,0 +1480,0 @@ for(var i in core) if( core.hasOwnProperty(i) && typeof core[i] === "function" ) {

@@ -169,3 +169,4 @@ "use strict";

this.alter.insertBefore(fnBodyStart, "{", {extend: true});
this.alter.insert(fnBodyEnd, "}", {extend: true});
// this.alter.insertBefore(fnBodyEnd, "}", {extend: true});
this.alter.insert(fnBodyEnd, "}");

@@ -172,0 +173,0 @@ if( fnBodyHasHiddenBrackets ) {

@@ -23,5 +23,3 @@ "use strict";

var $defineProperty = "Object.defineProperty";
var $defineProperties = "Object.defineProperties";
var $GOPDS_P = "Object.getOwnPropertyDescriptors||function(o){" +
var $GOPDS_P = "function(o){" +
"var d=Object.create(null);" +

@@ -54,2 +52,5 @@ "for(var p in o)if(o.hasOwnProperty(p)){" +

this.options = options;
core.registerVar('getPropertiesDef', {name: 'GOPDS_P', template: $GOPDS_P});
core.registerVar('getAccessorsDef', {name: 'GOPDS_A', template: $GOPDS_A});
}

@@ -98,7 +99,2 @@

var Object_defineProperty_name;
var Object_defineProperties_name;
var $GOPDS_P_name;
var $GOPDS_A_name;
var objectOpened = '';

@@ -146,18 +142,8 @@

if ( !Object_defineProperty_name ) {
Object_defineProperty_name = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
}
beforeString = Object_defineProperty_name + '(' + beforeString;
beforeString = core.createVars(node, "defineProperty") + '(' + beforeString;
}
else {
if ( !Object_defineProperties_name ) {
Object_defineProperties_name = core.bubbledVariableDeclaration(node.$scope, "DPS", $defineProperties);
}
beforeString = core.createVars(node, "defineProperties") + '(' + beforeString;
beforeString = Object_defineProperties_name + '(' + beforeString;
if ( !$GOPDS_A_name ) {
$GOPDS_A_name = core.bubbledVariableDeclaration(node.$scope, "GOPDS_A", $GOPDS_A);
}
this.alter.insertBefore(property.range[0], $GOPDS_A_name + '({');
this.alter.insertBefore(property.range[0], core.createVars(node, "getAccessorsDef") + '({');
}

@@ -191,8 +177,4 @@

if ( !Object_defineProperty_name ) {
Object_defineProperty_name = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
}
beforeString = core.createVars(node, "defineProperty") + '(' + beforeString;
beforeString = Object_defineProperty_name + '(' + beforeString;
var propKey$0 = property.key;

@@ -216,14 +198,7 @@ if ( isComputed ) {

else if ( computedReplacementStarted ) {
if ( !Object_defineProperties_name ) {
Object_defineProperties_name = core.bubbledVariableDeclaration(node.$scope, "DPS", $defineProperties);
}
beforeString = core.createVars(node, "defineProperties") + '(' + beforeString;
beforeString = Object_defineProperties_name + '(' + beforeString;
closeOpenTag(prevProperty);
if ( !$GOPDS_P_name ) {
$GOPDS_P_name = core.bubbledVariableDeclaration(node.$scope, "GOPDS_P", $GOPDS_P);
}
this.alter.insertBefore(property.range[0], $GOPDS_P_name + '({', {extend: true});
this.alter.insertBefore(property.range[0], core.createVars(node, "getPropertiesDef") + '({', {extend: true});

@@ -230,0 +205,0 @@ endFragment = '}))';

@@ -158,3 +158,3 @@ /*globals module,require*/

this.alter.insert(start, "(" + temporaryVarName);
this.alter.insertBefore(end, ")");
this.alter.insertBefore(end, ")", {extend: true});
}

@@ -161,0 +161,0 @@

@@ -65,3 +65,3 @@ "use strict";

function getRange(node) {
return node && (node.groupRange || node.range);
return node && (node.bracesRange || node.groupRange || node.range);
}

@@ -124,2 +124,6 @@

var argsLength = args.length;
var isSuper = isMemberExpression
? node.callee.object.$originalName === 'super' || node.callee.object.name === 'super'
: node.callee.$originalName === 'super' || node.callee.name === 'super'
;

@@ -133,8 +137,15 @@ assert(argsLength);

if( isMemberExpression ) {
if( isSimpleMemberExpression ) {
expressionInside =
".apply("
+ this.alter.get(node.callee.object.range[0], node.callee.object.range[1])
+ ", "
;
if( isSimpleMemberExpression || isSuper ) {
if ( isSuper ) {
expressionInside =
".apply(this, "
;
}
else {
expressionInside =
".apply("
+ this.alter.get(node.callee.object.range[0], node.callee.object.range[1])
+ ", "
;
}
}

@@ -157,5 +168,12 @@ else {

else {
expressionInside =
".apply(null, "
;
if ( isSuper ) {
expressionInside =
".apply(this, "
;
}
else {
expressionInside =
".apply(null, "
;
}

@@ -162,0 +180,0 @@ if( node.callee.type === "FunctionExpression" ) {

{
"name": "es6-transpiler",
"version": "0.7.15",
"version": "0.7.16-1",
"description": "es6 -> es5",

@@ -12,3 +12,3 @@ "main": "./build/es5/es6-transpiler.js",

"dependencies": {
"es5-shim": "2.3.0",
"es5-shim": "~4.0.0",
"es6-shim": "latest",

@@ -15,0 +15,0 @@ "simple-fmt": "~0.1.0",

@@ -188,3 +188,3 @@ # es6-transpiler.js

//described above:
//"filename" or "scr": "string"
//"filename" or "src": "string"
//outputToConsole: false

@@ -191,0 +191,0 @@ //outputFilename: true

var Board = (function(){"use strict";var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var Board = (function(){"use strict";var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};
function Board(el) {
this.element = document.getElementById(el);
}DP$0(Board, "prototype", {"configurable": false, "enumerable": false, "writable": false});
}DP$0(Board,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return Board;})();

@@ -1,26 +0,26 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};
var moduleGreeter = {
Greeter: ((function(){"use strict";var $static$0={},$proto$0={};
$static$0.test = function(){ return "test" };
Greeter: ((function(){"use strict";var static$0={},proto$0={};
static$0.test = function(){ return "test" };
function constructor$0(message) {
this.greeting = message;
}DP$0(constructor$0, "prototype", {"configurable": false, "enumerable": false, "writable": false});
}DP$0(constructor$0,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$proto$0.greet = function() {
proto$0.greet = function() {
return "Hello 1, " + this.greeting;
};
MIXIN$0(constructor$0,$static$0);MIXIN$0(constructor$0.prototype,$proto$0);$static$0=$proto$0=void 0;return constructor$0;})())
MIXIN$0(constructor$0,static$0);MIXIN$0(constructor$0.prototype,proto$0);static$0=proto$0=void 0;return constructor$0;})())
};
var moduleGreeter1 = {
Greeter1: ((function(super$0){"use strict";MIXIN$0(constructor$1, super$0);var $proto$0={};
Greeter1: ((function(super$0){"use strict";var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;if(!PRS$0)MIXIN$0(constructor$1, super$0);var proto$0={};
function constructor$1(message) {
super$0.call(this, message);
this.greeting = message;
}constructor$1.prototype = Object.create(super$0.prototype, {"constructor": {"value": constructor$1, "configurable": true, "writable": true} });DP$0(constructor$1, "prototype", {"configurable": false, "enumerable": false, "writable": false});
$proto$0.greet = function() {
}if(super$0!==null)SP$0(constructor$1,super$0);constructor$1.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":constructor$1,"configurable":true,"writable":true}});DP$0(constructor$1,"prototype",{"configurable":false,"enumerable":false,"writable":false});
proto$0.greet = function() {
return super$0.prototype.greet.call(this) + "Hello 2, " + this.greeting;
};
MIXIN$0(constructor$1.prototype,$proto$0);$proto$0=void 0;return constructor$1;})(moduleGreeter.Greeter))
MIXIN$0(constructor$1.prototype,proto$0);proto$0=void 0;return constructor$1;})(moduleGreeter.Greeter))
};

@@ -27,0 +27,0 @@

@@ -1,22 +0,22 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};
var a = 'method1', b = 'method2', x = 'asd';
var A = (function(){"use strict";function A() {}DP$0(A, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={},$proto$0={};
$static$0.test1 = function(){ return 'test1' };
$proto$0.test2 = function(){ return 'test2' };
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={},proto$0={};
static$0.test1 = function(){ return 'test1' };
proto$0.test2 = function(){ return 'test2' };
DP$0(A.prototype,a,{"set":function(x){ throw new Error('you can\'t set ' + a) },"configurable":true,"enumerable":true});
MIXIN$0(A,$static$0);MIXIN$0(A.prototype,$proto$0);$static$0=$proto$0=void 0;return A;})();
MIXIN$0(A,static$0);MIXIN$0(A.prototype,proto$0);static$0=proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}MIXIN$0(B, super$0);B.prototype = Object.create(super$0.prototype, {"constructor": {"value": B, "configurable": true, "writable": true}, c: {"get": c$get$0, "set": c$set$0, "configurable": true, "enumerable": true} });DP$0(B, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={},$proto$0={};
var B = (function(super$0){"use strict";var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;var DPS$0 = Object.defineProperties;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}, c: {"get": c$get$0, "set": c$set$0, "configurable":true,"enumerable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={},proto$0={};
$proto$0[a] = function() {
proto$0[a] = function() {
return a;
};
$proto$0[b] = function() {
proto$0[b] = function() {
return b;
};
$proto$0.a = function(){ return 123 };
proto$0.a = function(){ return 123 };

@@ -29,11 +29,11 @@ DP$0(B.prototype,x + 1,{"get":function(){ return this.__x },"configurable":true,"enumerable":true});

$static$0[a] = function() {
static$0[a] = function() {
return a;
};
$static$0[b] = function() {
static$0[b] = function() {
return b;
};
$static$0.a = function(){ return 123 };
static$0.a = function(){ return 123 };

@@ -43,5 +43,5 @@ DP$0(B,x + 1,{"get":function(){ return this.__x },"configurable":true,"enumerable":true});

function static_c$get$0(){ return this.__c };Object.defineProperties(B, {c: {"get": static_c$get$0, "set": static_c$set$0, "configurable": true, "enumerable": true}});
function static_c$get$0(){ return this.__c };DPS$0(B,{c: {"get": static_c$get$0, "set": static_c$set$0, "configurable":true,"enumerable":true}});
function static_c$set$0(a){ this.__c = a + 9 }
MIXIN$0(B,$static$0);MIXIN$0(B.prototype,$proto$0);$static$0=$proto$0=void 0;return B;})(A);
MIXIN$0(B,static$0);MIXIN$0(B.prototype,proto$0);static$0=proto$0=void 0;return B;})(A);

@@ -48,0 +48,0 @@ var objA = new A();

@@ -1,16 +0,16 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;
var secret = Object.create(null);
var A = (function(){"use strict";function A() {}DP$0(A, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};
$proto$0.m1 = function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0.m1 = function() {
return secret;
};
MIXIN$0(A.prototype,$proto$0);$proto$0=void 0;return A;})();
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
{// anon class
var v = new ((function(super$0){"use strict";function constructor$0() {super$0.apply(this, arguments)}MIXIN$0(constructor$0, super$0);constructor$0.prototype = Object.create(super$0.prototype, {"constructor": {"value": constructor$0, "configurable": true, "writable": true} });DP$0(constructor$0, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={};
$static$0.sMethod = function() {
var v = new ((function(super$0){"use strict";function constructor$0() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(constructor$0, super$0);if(super$0!==null)SP$0(constructor$0,super$0);constructor$0.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":constructor$0,"configurable":true,"writable":true}});DP$0(constructor$0,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.sMethod = function() {
// can't call this method
};
MIXIN$0(constructor$0,$static$0);$static$0=void 0;return constructor$0;})(A));
MIXIN$0(constructor$0,static$0);static$0=void 0;return constructor$0;})(A));

@@ -23,7 +23,7 @@ console.log(v.m1() === secret);

var Class = (((function(super$0){"use strict";function constructor$1() {super$0.apply(this, arguments)}MIXIN$0(constructor$1, super$0);constructor$1.prototype = Object.create(super$0.prototype, {"constructor": {"value": constructor$1, "configurable": true, "writable": true} });DP$0(constructor$1, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={};
$static$0.sMethod = function() {
var Class = (((function(super$0){"use strict";function constructor$1() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(constructor$1, super$0);if(super$0!==null)SP$0(constructor$1,super$0);constructor$1.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":constructor$1,"configurable":true,"writable":true}});DP$0(constructor$1,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.sMethod = function() {
return secret2;
};
MIXIN$0(constructor$1,$static$0);$static$0=void 0;return constructor$1;})(A)));
MIXIN$0(constructor$1,static$0);static$0=void 0;return constructor$1;})(A)));
var v$0 = new Class;

@@ -37,10 +37,10 @@

var v$1 = new ((function(super$0){"use strict";function B() {super$0.apply(this, arguments)}MIXIN$0(B, super$0);B.prototype = Object.create(super$0.prototype, {"constructor": {"value": B, "configurable": true, "writable": true} });DP$0(B, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={},$proto$0={};
$static$0.sMethod = function() {
var v$1 = new ((function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={},proto$0={};
static$0.sMethod = function() {
return secret2$0;
};
$proto$0.test = function() {
proto$0.test = function() {
return B.sMethod();
};
MIXIN$0(B,$static$0);MIXIN$0(B.prototype,$proto$0);$static$0=$proto$0=void 0;return B;})(A));
MIXIN$0(B,static$0);MIXIN$0(B.prototype,proto$0);static$0=proto$0=void 0;return B;})(A));

@@ -54,10 +54,10 @@ console.log(v$1.m1() === secret, v$1.test() === secret2$0);

var Class$0 = (((function(super$0){"use strict";function B() {super$0.apply(this, arguments)}MIXIN$0(B, super$0);B.prototype = Object.create(super$0.prototype, {"constructor": {"value": B, "configurable": true, "writable": true} });DP$0(B, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={},$proto$0={};
$static$0.sMethod = function() {
var Class$0 = (((function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={},proto$0={};
static$0.sMethod = function() {
return secret2$1;
};
$proto$0.test = function() {
proto$0.test = function() {
return B.sMethod();
};
MIXIN$0(B,$static$0);MIXIN$0(B.prototype,$proto$0);$static$0=$proto$0=void 0;return B;})(A)));
MIXIN$0(B,static$0);MIXIN$0(B.prototype,proto$0);static$0=proto$0=void 0;return B;})(A)));
var v$2 = new Class$0;

@@ -64,0 +64,0 @@

@@ -1,3 +0,3 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var A = (function(){"use strict";function A() {}Object.defineProperties(A.prototype, {a: {"get": a$get$0, "set": a$set$0, "configurable": true, "enumerable": true}});DP$0(A, "prototype", {"configurable": false, "enumerable": false, "writable": false});
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var DPS$0 = Object.defineProperties;var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$0, "set": a$set$0, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$0() {

@@ -12,3 +12,3 @@ return this._a;

var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}MIXIN$0(B, super$0);B.prototype = Object.create(super$0.prototype, {"constructor": {"value": B, "configurable": true, "writable": true}, b: {"get": b$get$0, "set": b$set$0, "configurable": true, "enumerable": true}, 'c': {"get": c$get$0, "set": c$set$0, "configurable": true, "enumerable": true} });DP$0(B, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}, b: {"get": b$get$0, "set": b$set$0, "configurable":true,"enumerable":true}, 'c': {"get": c$get$0, "set": c$set$0, "configurable":true,"enumerable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
function b$get$0() {

@@ -18,3 +18,3 @@ return this._b;

$proto$0.m = function(){ return "m" };
proto$0.m = function(){ return "m" };

@@ -28,7 +28,7 @@ function b$set$0(val) {

function static_d$get$0(){ return this._d };Object.defineProperties(B, {d: {"get": static_d$get$0, "set": static_d$set$0, "configurable": true, "enumerable": true}});
function static_d$get$0(){ return this._d };DPS$0(B,{d: {"get": static_d$get$0, "set": static_d$set$0, "configurable":true,"enumerable":true}});
function static_d$set$0(val){ this._d = val + 999 }
MIXIN$0(B.prototype,$proto$0);$proto$0=void 0;return B;})(A);;
MIXIN$0(B.prototype,proto$0);proto$0=void 0;return B;})(A);;
var C = (function(super$0){"use strict";function C() {super$0.apply(this, arguments)}MIXIN$0(C, super$0);C.prototype = Object.create(super$0.prototype, {"constructor": {"value": C, "configurable": true, "writable": true}, 'e': {"get": e$get$0, "set": e$set$0, "configurable": true, "enumerable": true}, f: {"get": f$get$0, "configurable": true, "enumerable": true}, g: {"set": g$set$0, "configurable": true, "enumerable": true} });DP$0(C, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={};
var C = (function(super$0){"use strict";function C() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(C, super$0);if(super$0!==null)SP$0(C,super$0);C.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":C,"configurable":true,"writable":true}, 'e': {"get": e$get$0, "set": e$set$0, "configurable":true,"enumerable":true}, f: {"get": f$get$0, "configurable":true,"enumerable":true}, g: {"set": g$set$0, "configurable":true,"enumerable":true}});DP$0(C,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
function e$set$0(val){ this._e = val * 3 }

@@ -41,4 +41,4 @@ function e$get$0(){ return this._e }

$static$0.m = function(){ return "m" };
MIXIN$0(C,$static$0);$static$0=void 0;return C;})(B);;
static$0.m = function(){ return "m" };
MIXIN$0(C,static$0);static$0=void 0;return C;})(B);;

@@ -45,0 +45,0 @@ // TODO::

@@ -1,33 +0,570 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};var Greeter = (function(){"use strict";var $static$0={},$proto$0={};
$static$0.test = function(){ return "test" };
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var DPS$0 = Object.defineProperties;
// simple class
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});;return A;})();
//static A = 123;
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A();
function Greeter(message) {
this.greeting = message;
}DP$0(Greeter, "prototype", {"configurable": false, "enumerable": false, "writable": false});
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0);
})();
$proto$0.greet = function() {
return "Hello 1, " + this.greeting;
};
MIXIN$0(Greeter,$static$0);MIXIN$0(Greeter.prototype,$proto$0);$static$0=$proto$0=void 0;return Greeter;})();
// simple class with constructor
(function() {
var A = (function(){"use strict";
function A(a) {
this.a = a;
}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return A;})();
var Greeter1 = (function(super$0){"use strict";MIXIN$0(Greeter1, super$0);var $proto$0={};
function Greeter1(message) {
super$0.call(this, message);
this.greeting = message;
}Greeter1.prototype = Object.create(super$0.prototype, {"constructor": {"value": Greeter1, "configurable": true, "writable": true} });DP$0(Greeter1, "prototype", {"configurable": false, "enumerable": false, "writable": false});
$proto$0.greet = function() {
return super$0.prototype.greet.call(this) + "Hello 2, " + this.greeting;
};
MIXIN$0(Greeter1.prototype,$proto$0);$proto$0=void 0;return Greeter1;})(Greeter);
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A('test');
var A = (function(){"use strict";function A() {}DP$0(A, "prototype", {"configurable": false, "enumerable": false, "writable": false});
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0);
})();
;return A;})();
// simple class with method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0.a = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
//console.log(Greeter.A === 123);
//console.log(Greeter1.A === 123);
console.log(Greeter1.test() === "test");
console.log((new Greeter1("test | 3")).greet() === "Hello 1, test | 3Hello 2, test | 3");
console.log(new A instanceof A);
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a.a() === 'test');
})();
// simple class with static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.a = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A.a() === 'test');
})();
// simple class with getter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$0, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$0() {
return 'test'
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a.a === 'test');
})();
// simple class with setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"set": a$set$0, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$0(a) {
this._a = a + '_' + 9;
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$0() {
return 'test'
};DPS$0(A,{a: {"get": static_a$get$0, "configurable":true,"enumerable":true}});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A.a === 'test');
})();
// simple class with static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$0(a) {
this._a = a + '_' + 9;
};DPS$0(A,{a: {"set": static_a$set$0, "configurable":true,"enumerable":true}});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with getter and setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$1, "set": a$set$1, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$1() {
return this._a;
}
function a$set$1(a) {
this._a = a + '_' + 9;
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a.a === 'test_9', a._a === 'test_9');
})();
// simple class with static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$1() {
return this._a;
};DPS$0(A,{a: {"get": static_a$get$1, "set": static_a$set$1, "configurable":true,"enumerable":true}});
function static_a$set$1(a) {
this._a = a + '_' + 9;
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A.a === 'test_9', A._a === 'test_9');
})();
// --------------------======================== LITERAL ========================--------------------
// simple class with literal constructor
(function() {
var A = (function(){"use strict";
function A(a) {
this.a = a;
}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A('test');
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0, a.a === 'test');
})();
// simple class with literal method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a']() === 'test');
})();
// simple class with literal static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a']() === 'test');
})();
// simple class with literal getter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"get": a$get$2, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$2() {
return 'test'
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test');
})();
// simple class with literal setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"set": a$set$2, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$2(a) {
this._a = a + '_' + 9;
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with literal static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$2() {
return 'test'
};DPS$0(A,{'a': {"get": static_a$get$2, "configurable":true,"enumerable":true}});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test');
})();
// simple class with literal static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$2(a) {
this._a = a + '_' + 9;
};DPS$0(A,{'a': {"set": static_a$set$2, "configurable":true,"enumerable":true}});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with literal getter and setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"get": a$get$3, "set": a$set$3, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$3() {
return this._a;
}
function a$set$3(a) {
this._a = a + '_' + 9;
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test_9', a._a === 'test_9');
})();
// simple class with literal static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$3() {
return this._a;
};DPS$0(A,{'a': {"get": static_a$get$3, "set": static_a$set$3, "configurable":true,"enumerable":true}});
function static_a$set$3(a) {
this._a = a + '_' + 9;
}
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test_9', A._a === 'test_9');
})();
// --------------------======================== SIMPLE COMPUTED ========================--------------------
// TODO::
//// simple class with simple computed constructor
//(function() {
// class A {
// ['constructor'](a) {
// this.a = a;
// }
// }
//
// let a = new A('test');
//
// console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0, a.a === 'test');
//})();
// simple class with simple computed method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a']() === 'test');
})();
// simple class with simple computed static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a']() === 'test');
})();
// simple class with simple computed getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a',{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test');
})();
// simple class with simple computed setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a',{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with simple computed static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a',{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test');
})();
// simple class with simple computed static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a',{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with simple computed getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a',{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A.prototype,'a',{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test_9', a._a === 'test_9');
})();
// simple class with simple computed static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a',{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A,'a',{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test_9', A._a === 'test_9');
})();
// --------------------======================== COMPUTED ========================--------------------
var postfix = 'd' + Math.random(), constructorPostfix = 'ctor';
// TODO::
//// simple class with computed constructor
//(function() {
// class A {
// ['constru' + constructorPostfix](a) {
// this.a = a;
// }
// }
//
// let a = new A('test');
//
// console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0, a.a === 'test');
//})();
// simple class with computed method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a' + postfix] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a' + postfix]() === 'test');
})();
// simple class with computed static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a' + postfix] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a' + postfix]() === 'test');
})();
// simple class with computed getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a' + postfix] === 'test');
})();
// simple class with computed setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with computed static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a' + postfix] === 'test');
})();
// simple class with computed static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with computed getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A.prototype,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
a['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a' + postfix] === 'test_9', a._a === 'test_9');
})();
// simple class with computed static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var pk = Object.keys(A.prototype);var sk = Object.keys(A);
var a = new A;
A['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a' + postfix] === 'test_9', A._a === 'test_9');
})();

@@ -1,20 +0,20 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;
function inStrictMode() {
"use strict";
var A = (function(){function A() {}DP$0(A, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};//class body should be in strict mode, but in this case in already in strict mode
var A = (function(){function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};//class body should be in strict mode, but in this case in already in strict mode
$proto$0.test = function(a) {
proto$0.test = function(a) {
arguments[0] = a + 1;
return [a, arguments[0]];
};
MIXIN$0(A.prototype,$proto$0);$proto$0=void 0;return A;})();
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){function B() {super$0.apply(this, arguments)}MIXIN$0(B, super$0);B.prototype = Object.create(super$0.prototype, {"constructor": {"value": B, "configurable": true, "writable": true} });DP$0(B, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};//class body should be in strict mode, but in this case in already in strict mode
var B = (function(super$0){function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};//class body should be in strict mode, but in this case in already in strict mode
$proto$0.test = function(a) {
proto$0.test = function(a) {
arguments[0] = a + 1;
return [a, arguments[0]];
};
MIXIN$0(B.prototype,$proto$0);$proto$0=void 0;return B;})(A);
MIXIN$0(B.prototype,proto$0);proto$0=void 0;return B;})(A);

@@ -40,17 +40,17 @@ function simpleFunc(a) {// this function is in strict mode

var A = (function(){"use strict";function A() {}DP$0(A, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};//class body should be in strict mode
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};//class body should be in strict mode
$proto$0.test = function(a) {
proto$0.test = function(a) {
arguments[0] = a + 1;
return [a, arguments[0]];
};
MIXIN$0(A.prototype,$proto$0);$proto$0=void 0;return A;})();
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}MIXIN$0(B, super$0);B.prototype = Object.create(super$0.prototype, {"constructor": {"value": B, "configurable": true, "writable": true} });DP$0(B, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};//class body should be in strict mode
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};//class body should be in strict mode
$proto$0.test = function(a) {
proto$0.test = function(a) {
arguments[0] = a + 1;
return [a, arguments[0]];
};
MIXIN$0(B.prototype,$proto$0);$proto$0=void 0;return B;})(A);
MIXIN$0(B.prototype,proto$0);proto$0=void 0;return B;})(A);

@@ -72,2 +72,2 @@ function simpleFunc(a) {// this function not! in strict mode

}
notInStrictMode();
notInStrictMode();

@@ -1,5 +0,5 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;var DPS$0 = Object.defineProperties;var SLICE$0 = Array.prototype.slice;var S_ITER$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol.iterator||'@@iterator';var S_MARK$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol["__setObjectSetter__"];function ITER$0(v,f){if(v){if(Array.isArray(v))return f?v.slice():v;var i,r;if(S_MARK$0)S_MARK$0(v);if(typeof v==='object'&&typeof (f=v[S_ITER$0])==='function'){i=f.call(v);r=[];}else if((v+'')==='[object Generator]'){i=v;r=[];};if(S_MARK$0)S_MARK$0(void 0);if(r) {while((f=i['next']()),f['done']!==true)r.push(f['value']);return r;}}throw new Error(v+' is not iterable')};
var testCall = false;
var Foo = (function(){"use strict";function Foo() {}DP$0(Foo, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $static$0={};
$static$0.doIt = function(test) {
var Foo = (function(){"use strict";function Foo() {}DP$0(Foo,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.doIt = function(test) {
if ( test ) {

@@ -12,5 +12,5 @@ testCall = true;

};
MIXIN$0(Foo,$static$0);$static$0=void 0;return Foo;})();
MIXIN$0(Foo,static$0);static$0=void 0;return Foo;})();
var Base = (function(super$0){"use strict";MIXIN$0(Base, super$0);
var Base = (function(super$0){"use strict";if(!PRS$0)MIXIN$0(Base, super$0);var static$0={},proto$0={};
function Base() {

@@ -21,5 +21,136 @@ super$0.call(this);

super$0.doIt.call(this);
}Base.prototype = Object.create(super$0.prototype, {"constructor": {"value": Base, "configurable": true, "writable": true} });DP$0(Base, "prototype", {"configurable": false, "enumerable": false, "writable": false});
;return Base;})(Foo);
}if(super$0!==null)SP$0(Base,super$0);Base.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":Base,"configurable":true,"writable":true}});DP$0(Base,"prototype",{"configurable":false,"enumerable":false,"writable":false});
console.log( ((new Base).test === 999 && testCall) === true );
proto$0.getParentClass = function() {
return super$0;
};
static$0.getParentClass = function() {
return super$0;
};
MIXIN$0(Base,static$0);MIXIN$0(Base.prototype,proto$0);static$0=proto$0=void 0;return Base;})(Foo);
console.log( ((new Base).test === 999 && testCall) === true, (new Base).getParentClass() == Foo, Base.getParentClass() == Foo );
// --------------------======================== SPREAD ========================--------------------
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{prop1: {"get": prop1$get$0, "set": prop1$set$0, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={},proto$0={};
proto$0.a = function() {var rest = SLICE$0.call(arguments, 0);
return rest.reverse();
};
static$0.a = function() {var rest = SLICE$0.call(arguments, 0);
return ['static'].concat(ITER$0(rest)).reverse();
};
proto$0.c = function() {var rest = SLICE$0.call(arguments, 0);
return rest.reverse();
};
static$0.c = function() {var rest = SLICE$0.call(arguments, 0);
return ['static'].concat(ITER$0(rest)).reverse();
};
proto$0.d = function() {var rest = SLICE$0.call(arguments, 0);
return rest.reverse();
};
static$0.d = function() {var rest = SLICE$0.call(arguments, 0);
return ['static'].concat(ITER$0(rest)).reverse();
};
function prop1$get$0() {
return this.a.apply(this, ITER$0(this._prop1));
}
function static_prop1$get$0() {
return this.a.apply(this, ITER$0(this._prop1));
};DPS$0(A,{prop1: {"get": static_prop1$get$0, "set": static_prop1$set$0, "configurable":true,"enumerable":true}});
function prop1$set$0() {var rest = SLICE$0.call(arguments, 0);
this._prop1 = rest;
}
function static_prop1$set$0() {var rest = SLICE$0.call(arguments, 0);
this._prop1 = ['static'].concat(ITER$0(rest));
}
MIXIN$0(A,static$0);MIXIN$0(A.prototype,proto$0);static$0=proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";var $D$0;var $D$1;var CNAMES$0 = [];var GET_CNAMES$0 = function f(o){var r,u;for(var p in o)if((r=o[p])&&typeof r ==='object'&&(u=r["__unq"])){CNAMES$0[u]=p;delete r["__unq"];}return o;};;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,GET_CNAMES$0({"constructor":{"value":B,"configurable":true,"writable":true}, prop1: {"get": prop1$get$1, "set": prop1$set$1, "configurable":true,"enumerable":true, "__unq": 1}}));$D$0=CNAMES$0[1];delete CNAMES$0[1];;DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={},proto$0={};
proto$0.a = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.prototype.a.apply(this, ITER$0(rest));
};
static$0.a = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.a.apply(this, ITER$0(rest));
};
proto$0.c = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.prototype.c.apply(this, [1, 2, 3].concat(ITER$0(rest)));
};
static$0.c = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.c.apply(this, [1, 2, 3].concat(ITER$0(rest)));
};
proto$0.d = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.prototype.d.apply(this, [ ].concat(ITER$0(rest, true), ['|'], ITER$0(rest.reverse())));
};
static$0.d = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.d.apply(this, [ ].concat(ITER$0(rest, true), ['|'], ITER$0(rest.reverse())));
};
proto$0.a1 = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.prototype.a.apply(this, [1].concat(ITER$0(rest)));
};
static$0.a1 = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.a.apply(this, [1].concat(ITER$0(rest)));
};
proto$0.a2 = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.prototype.a.apply(this, [1, 2].concat(ITER$0(rest)));
};
static$0.a2 = function() {var rest = SLICE$0.call(arguments, 0);
return super$0.a.apply(this, [1, 2].concat(ITER$0(rest)));
};
function prop1$get$1() {
return GOPD$0(super$0.prototype,$D$0)["get"].call(this);
}
function static_prop1$get$1() {
return GOPD$0(super$0,$D$1)["get"].call(this);
};DPS$0(B,GET_CNAMES$0({prop1: {"get": static_prop1$get$1, "set": static_prop1$set$1, "configurable":true,"enumerable":true, "__unq": 2}}));$D$1=CNAMES$0[2];delete CNAMES$0[2];;
function prop1$set$1() {var rest = SLICE$0.call(arguments, 0);
GOPD$0(super$0.prototype,$D$0)["set"].apply(this, ITER$0(rest));
}
function static_prop1$set$1() {var rest = SLICE$0.call(arguments, 0);
GOPD$0(super$0,$D$1)["set"].apply(this, ITER$0(rest));
}
MIXIN$0(B,static$0);MIXIN$0(B.prototype,proto$0);static$0=proto$0=void 0;return B;})(A);
console.log(A.a(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'), A.c(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'), A.d(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'));
console.log(B.a(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'));
console.log(B.c(1, 2, 3).join('|') === [3, 2, 1, 3, 2, 1, 'static'].join('|'));
console.log(B.d(1, 2, 3).join('|') === [1, 2, 3, '|', 3, 2, 1, 'static'].join('|'));
console.log(B.a1(2, 3).join('|') === [3, 2, 1, 'static'].join('|'));
console.log(B.a2(3).join('|') === [3, 2, 1, 'static'].join('|'));
var a = new A;
var b = new B;
console.log(a.a(1, 2, 3).join('|') === [3, 2, 1].join('|'), a.c(1, 2, 3).join('|') === [3, 2, 1].join('|'), a.d(1, 2, 3).join('|') === [3, 2, 1].join('|'));
console.log(b.a(1, 2, 3).join('|') === [3, 2, 1].join('|'));
console.log(b.c(1, 2, 3).join('|') === [3, 2, 1, 3, 2, 1].join('|'));
console.log(b.d(1, 2, 3).join('|') === [1, 2, 3, '|', 3, 2, 1].join('|'));
console.log(b.a1(2, 3).join('|') === [3, 2, 1].join('|'));
console.log(b.a2(3).join('|') === [3, 2, 1].join('|'));

@@ -21,4 +21,135 @@

}
getParentClass() {
return super;
}
static getParentClass() {
return super;
}
}
console.log( ((new Base).test === 999 && testCall) === true );
console.log( ((new Base).test === 999 && testCall) === true, (new Base).getParentClass() == Foo, Base.getParentClass() == Foo );
// --------------------======================== SPREAD ========================--------------------
class A {
a(...rest) {
return rest.reverse();
}
static a(...rest) {
return ['static', ...rest].reverse();
}
c(...rest) {
return rest.reverse();
}
static c(...rest) {
return ['static', ...rest].reverse();
}
d(...rest) {
return rest.reverse();
}
static d(...rest) {
return ['static', ...rest].reverse();
}
get prop1() {
return this.a(...this._prop1);
}
static get prop1() {
return this.a(...this._prop1);
}
set prop1(...rest) {
this._prop1 = rest;
}
static set prop1(...rest) {
this._prop1 = ['static', ...rest];
}
}
class B extends A {
a(...rest) {
return super(...rest);
}
static a(...rest) {
return super(...rest);
}
c(...rest) {
return super(1, 2, 3, ...rest);
}
static c(...rest) {
return super(1, 2, 3, ...rest);
}
d(...rest) {
return super(...[...rest, '|', ...rest.reverse()]);
}
static d(...rest) {
return super(...[...rest, '|', ...rest.reverse()]);
}
a1(...rest) {
return super.a(1, ...rest);
}
static a1(...rest) {
return super.a(1, ...rest);
}
a2(...rest) {
return super.a(1, 2, ...rest);
}
static a2(...rest) {
return super.a(1, 2, ...rest);
}
get prop1() {
return super();
}
static get prop1() {
return super();
}
set prop1(...rest) {
super(...rest);
}
static set prop1(...rest) {
super(...rest);
}
}
console.log(A.a(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'), A.c(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'), A.d(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'));
console.log(B.a(1, 2, 3).join('|') === [3, 2, 1, 'static'].join('|'));
console.log(B.c(1, 2, 3).join('|') === [3, 2, 1, 3, 2, 1, 'static'].join('|'));
console.log(B.d(1, 2, 3).join('|') === [1, 2, 3, '|', 3, 2, 1, 'static'].join('|'));
console.log(B.a1(2, 3).join('|') === [3, 2, 1, 'static'].join('|'));
console.log(B.a2(3).join('|') === [3, 2, 1, 'static'].join('|'));
let a = new A;
let b = new B;
console.log(a.a(1, 2, 3).join('|') === [3, 2, 1].join('|'), a.c(1, 2, 3).join('|') === [3, 2, 1].join('|'), a.d(1, 2, 3).join('|') === [3, 2, 1].join('|'));
console.log(b.a(1, 2, 3).join('|') === [3, 2, 1].join('|'));
console.log(b.c(1, 2, 3).join('|') === [3, 2, 1, 3, 2, 1].join('|'));
console.log(b.d(1, 2, 3).join('|') === [1, 2, 3, '|', 3, 2, 1].join('|'));
console.log(b.a1(2, 3).join('|') === [3, 2, 1].join('|'));
console.log(b.a2(3).join('|') === [3, 2, 1].join('|'));

@@ -1,33 +0,570 @@

class Greeter {
static test(){ return "test" }
//static A = 123;
// simple class
(function() {
class A {}
constructor(message) {
this.greeting = message;
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A();
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0);
})();
// simple class with constructor
(function() {
class A {
constructor(a) {
this.a = a;
}
}
greet() {
return "Hello 1, " + this.greeting;
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A('test');
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0);
})();
// simple class with method
(function() {
class A {
a(a) {
return 'test'
}
}
}
class Greeter1 extends Greeter {
constructor(message) {
super(message);
this.greeting = message;
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a.a() === 'test');
})();
// simple class with static method
(function() {
class A {
static a(a) {
return 'test'
}
}
greet() {
return super.greet() + "Hello 2, " + this.greeting;
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A.a() === 'test');
})();
// simple class with getter
(function() {
class A {
get a() {
return 'test'
}
}
}
class A {
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
}
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a.a === 'test');
})();
//console.log(Greeter.A === 123);
//console.log(Greeter1.A === 123);
console.log(Greeter1.test() === "test");
console.log((new Greeter1("test | 3")).greet() === "Hello 1, test | 3Hello 2, test | 3");
console.log(new A instanceof A);
// simple class with setter
(function() {
class A {
set a(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with static getter
(function() {
class A {
static get a() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A.a === 'test');
})();
// simple class with static setter
(function() {
class A {
static set a(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with getter and setter
(function() {
class A {
get a() {
return this._a;
}
set a(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a.a === 'test_9', a._a === 'test_9');
})();
// simple class with static getter and setter
(function() {
class A {
static get a() {
return this._a;
}
static set a(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A.a = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A.a === 'test_9', A._a === 'test_9');
})();
// --------------------======================== LITERAL ========================--------------------
// simple class with literal constructor
(function() {
class A {
'constructor'(a) {
this.a = a;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A('test');
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0, a.a === 'test');
})();
// simple class with literal method
(function() {
class A {
'a'(a) {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a']() === 'test');
})();
// simple class with literal static method
(function() {
class A {
static 'a'(a) {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a']() === 'test');
})();
// simple class with literal getter
(function() {
class A {
get 'a'() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test');
})();
// simple class with literal setter
(function() {
class A {
set 'a'(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with literal static getter
(function() {
class A {
static get 'a'() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test');
})();
// simple class with literal static setter
(function() {
class A {
static set 'a'(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with literal getter and setter
(function() {
class A {
get 'a'() {
return this._a;
}
set 'a'(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test_9', a._a === 'test_9');
})();
// simple class with literal static getter and setter
(function() {
class A {
static get 'a'() {
return this._a;
}
static set 'a'(a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test_9', A._a === 'test_9');
})();
// --------------------======================== SIMPLE COMPUTED ========================--------------------
// TODO::
//// simple class with simple computed constructor
//(function() {
// class A {
// ['constructor'](a) {
// this.a = a;
// }
// }
//
// let a = new A('test');
//
// console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0, a.a === 'test');
//})();
// simple class with simple computed method
(function() {
class A {
['a'](a) {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a']() === 'test');
})();
// simple class with simple computed static method
(function() {
class A {
static ['a'](a) {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a']() === 'test');
})();
// simple class with simple computed getter
(function() {
class A {
get ['a']() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test');
})();
// simple class with simple computed setter
(function() {
class A {
set ['a'](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with simple computed static getter
(function() {
class A {
static get ['a']() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test');
})();
// simple class with simple computed static setter
(function() {
class A {
static set ['a'](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with simple computed getter and setter
(function() {
class A {
get ['a']() {
return this._a;
}
set ['a'](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a'] === 'test_9', a._a === 'test_9');
})();
// simple class with simple computed static getter and setter
(function() {
class A {
static get ['a']() {
return this._a;
}
static set ['a'](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A['a'] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a'] === 'test_9', A._a === 'test_9');
})();
// --------------------======================== COMPUTED ========================--------------------
let postfix = 'd' + Math.random(), constructorPostfix = 'ctor';
// TODO::
//// simple class with computed constructor
//(function() {
// class A {
// ['constru' + constructorPostfix](a) {
// this.a = a;
// }
// }
//
// let a = new A('test');
//
// console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 0, a.a === 'test');
//})();
// simple class with computed method
(function() {
class A {
['a' + postfix](a) {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a' + postfix]() === 'test');
})();
// simple class with computed static method
(function() {
class A {
static ['a' + postfix](a) {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a' + postfix]() === 'test');
})();
// simple class with computed getter
(function() {
class A {
get ['a' + postfix]() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a' + postfix] === 'test');
})();
// simple class with computed setter
(function() {
class A {
set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a._a === 'test_9');
})();
// simple class with computed static getter
(function() {
class A {
static get ['a' + postfix]() {
return 'test'
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a' + postfix] === 'test');
})();
// simple class with computed static setter
(function() {
class A {
static set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A._a === 'test_9');
})();
// simple class with computed getter and setter
(function() {
class A {
get ['a' + postfix]() {
return this._a;
}
set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
a['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 1, sk.length === 0, a['a' + postfix] === 'test_9', a._a === 'test_9');
})();
// simple class with computed static getter and setter
(function() {
class A {
static get ['a' + postfix]() {
return this._a;
}
static set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
let pk = Object.keys(A.prototype);let sk = Object.keys(A);
let a = new A;
A['a' + postfix] = 'test';
console.log(a.constructor == A, a instanceof A, pk.length === 0, sk.length === 1, A['a' + postfix] === 'test_9', A._a === 'test_9');
})();

@@ -1,35 +0,1052 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};var class1 = (function(){"use strict";var $static$0={},$proto$0={};
function class1(msg) {
this.property1 = msg;
}DP$0(class1, "prototype", {"configurable": false, "enumerable": false, "writable": false});
$static$0.sayStatic = function() { return "[static:class1]" };
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;var DPS$0 = Object.defineProperties;var CNAMES$0 = [];var GET_CNAMES$0 = function f(o){var r,u;for(var p in o)if((r=o[p])&&typeof r ==='object'&&(u=r["__unq"])){CNAMES$0[u]=p;delete r["__unq"];}return o;};;
// parent class and child class: without constructor
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});;return B;})(A);
$proto$0.say = function() { return "class1:" + this.property1 };
MIXIN$0(class1,$static$0);MIXIN$0(class1.prototype,$proto$0);$static$0=$proto$0=void 0;return class1;})();
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B();
var super$0;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B);
})();
var class2 = (function(super$1){"use strict";MIXIN$0(class2, super$1);var $static$0={},$proto$0={};
$static$0.sayStatic = function(){ return super$1.sayStatic() + "[static:class2]" };
// parent class and child class: with constructor
(function() {
var A = (function(){"use strict";
function A(a) {
this.a = a;
}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return A;})();
var B = (function(super$0){"use strict";if(!PRS$0)MIXIN$0(B, super$0);
function B(a) {
super$0.call(this, a);
}if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return B;})(A);
//static A = 123;
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B('test');
function class2(message) {var message = message.message;
super$0 = "test_super";//super variable test
super$1.call(this, message);
this.property2 = message;
}class2.prototype = Object.create(super$1.prototype, {"constructor": {"value": class2, "configurable": true, "writable": true} });DP$0(class2, "prototype", {"configurable": false, "enumerable": false, "writable": false});
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
$proto$0.say = function() {var a = arguments[0];if(a === void 0)a = 1;var b = (arguments[1] !== void 0 ? arguments[1] : [2])[0];
return super$1.prototype.say.call(this) + "|class2" + ":" + this.property2 + "|" + a + "|" + b + ":" + class2.sayStatic();
};
MIXIN$0(class2,$static$0);MIXIN$0(class2.prototype,$proto$0);$static$0=$proto$0=void 0;return class2;})(class1);
// parent class and child class: parent with constructor, child without constructor
(function() {
var A = (function(){"use strict";
function A(a) {
this.a = a;
}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var class3 = (function(super$1){"use strict";function class3() {super$1.apply(this, arguments)}MIXIN$0(class3, super$1);class3.prototype = Object.create(super$1.prototype, {"constructor": {"value": class3, "configurable": true, "writable": true} });DP$0(class3, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};
$proto$0.say = function(){return "class3"};
MIXIN$0(class3.prototype,$proto$0);$proto$0=void 0;return class3;})(class1);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B('test');
//console.log(class2.A === 123);
console.log((new class2({message: "test"})).say() === "class1:test|class2:test|1|2:[static:class1][static:class2]")
console.log((new class3()).say() === "class3")
console.log(super$0 === "test_super")
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
// parent class and child class: with method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0.a = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0.a = function(a) {
return super$0.prototype.a.call(this, a);
};
MIXIN$0(B.prototype,proto$0);proto$0=void 0;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b.a() === 'test');
})();
// parent class and child class: parent with method, child without method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0.a = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a() === 'test');
})();
// parent class and child class: with static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.a = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.a = function(a) {
return super$0.a.call(this, a);
};
MIXIN$0(B,static$0);static$0=void 0;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A.a() === 'test', B.a() === 'test');
})();
// parent class and child class: parent with static method, child without static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0.a = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A.a() === 'test', B.a() === 'test');
})();
// parent class and child class: with getter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$0, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$0() {
return 'test'
}
;return A;})();
var B = (function(super$0){"use strict";var $D$0;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,GET_CNAMES$0({"constructor":{"value":B,"configurable":true,"writable":true}, a: {"get": a$get$1, "configurable":true,"enumerable":true, "__unq": 1}}));$D$0=CNAMES$0[1];delete CNAMES$0[1];;DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$1() {
return GOPD$0(super$0.prototype,$D$0)["get"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
// parent class and child class: parent with getter, child without getter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$2, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$2() {
return 'test'
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
// parent class and child class: with setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"set": a$set$0, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$0(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";var $D$1;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,GET_CNAMES$0({"constructor":{"value":B,"configurable":true,"writable":true}, a: {"set": a$set$1, "configurable":true,"enumerable":true, "__unq": 1}}));$D$1=CNAMES$0[1];delete CNAMES$0[1];;DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$1(a) {
GOPD$0(super$0.prototype,$D$1)["set"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: parent with setter, child without setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"set": a$set$2, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$2(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: with static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$0() {
return 'test'
};DPS$0(A,{a: {"get": static_a$get$0, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";var $D$2;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$1() {
return GOPD$0(super$0,$D$2)["get"].call(this, a);
};DPS$0(B,GET_CNAMES$0({a: {"get": static_a$get$1, "configurable":true,"enumerable":true, "__unq": 1}}));$D$2=CNAMES$0[1];delete CNAMES$0[1];;
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A.a === 'test', B.a === 'test');
})();
// parent class and child class: parent with static getter, child without static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$2() {
return 'test'
};DPS$0(A,{a: {"get": static_a$get$2, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A.a === 'test', B.a === 'test');
})();
// parent class and child class: with static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$0(a) {
this._a = a + '_' + 9;
};DPS$0(A,{a: {"set": static_a$set$0, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";var $D$3;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$1(a) {
GOPD$0(super$0,$D$3)["set"].call(this, a);
};DPS$0(B,GET_CNAMES$0({a: {"set": static_a$set$1, "configurable":true,"enumerable":true, "__unq": 1}}));$D$3=CNAMES$0[1];delete CNAMES$0[1];;
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: parent with static setter, child without static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$2(a) {
this._a = a + '_' + 9;
};DPS$0(A,{a: {"set": static_a$set$2, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: with getter and setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$3, "set": a$set$3, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$3() {
return this._a;
}
function a$set$3(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";var $D$4;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,GET_CNAMES$0({"constructor":{"value":B,"configurable":true,"writable":true}, a: {"get": a$get$4, "set": a$set$4, "configurable":true,"enumerable":true, "__unq": 1}}));$D$4=CNAMES$0[1];delete CNAMES$0[1];;DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$4() {
return GOPD$0(super$0.prototype,$D$4)["get"].call(this, a);
}
function a$set$4(a) {
GOPD$0(super$0.prototype,$D$4)["set"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test_9', b._a === 'test_9');
})();
// parent class and child class: parent with getter and setter, child without getter and setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{a: {"get": a$get$5, "set": a$set$5, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$5() {
return this._a;
}
function a$set$5(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test_9', b._a === 'test_9');
})();
// parent class and child class: with static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$3() {
return this._a;
};DPS$0(A,{a: {"get": static_a$get$3, "set": static_a$set$3, "configurable":true,"enumerable":true}});
function static_a$set$3(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";var $D$5;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$4() {
return GOPD$0(super$0,$D$5)["get"].call(this, a);
};DPS$0(B,GET_CNAMES$0({a: {"get": static_a$get$4, "set": static_a$set$4, "configurable":true,"enumerable":true, "__unq": 1}}));$D$5=CNAMES$0[1];delete CNAMES$0[1];;
function static_a$set$4(a) {
GOPD$0(super$0,$D$5)["set"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A.a === void 0, B._a === 'test_9', B.a === 'test_9');
})();
// parent class and child class: with static getter and setter, child without static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$5() {
return this._a;
};DPS$0(A,{a: {"get": static_a$get$5, "set": static_a$set$5, "configurable":true,"enumerable":true}});
function static_a$set$5(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A.a === void 0, B._a === 'test_9', B.a === 'test_9');
})();
// --------------------======================== LITERAL ========================--------------------
// parent class and child class: with literal constructor
(function() {
var A = (function(){"use strict";
function A(a) {
this.a = a;
}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return A;})();
var B = (function(super$0){"use strict";if(!PRS$0)MIXIN$0(B, super$0);
function B(a) {
super$0.call(this, a);
}if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B('test');
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B);
})();
// parent class and child class: parent with literal constructor, child without literal constructor
(function() {
var A = (function(){"use strict";
function A(a) {
this.a = a;
}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B('test');
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B);
})();
// parent class and child class: with literal method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a'] = function(a) {
return super$0.prototype['a'].call(this, a);
};
MIXIN$0(B.prototype,proto$0);proto$0=void 0;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a']() === 'test');
})();
// parent class and child class: parent with literal method, child without literal method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a']() === 'test');
})();
// parent class and child class: with literal static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a'] = function(a) {
return super$0['a'].call(this, a);
};
MIXIN$0(B,static$0);static$0=void 0;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a']() === 'test', B['a']() === 'test');
})();
// parent class and child class: parent with literal static method, child without literal static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a'] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a']() === 'test', B['a']() === 'test');
})();
// parent class and child class: with literal getter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"get": a$get$6, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$6() {
return 'test'
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}, 'a': {"get": a$get$7, "configurable":true,"enumerable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$7() {
return GOPD$0(super$0.prototype,'a')["get"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test');
})();
// parent class and child class: parent with literal getter, child without literal getter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"get": a$get$8, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$8() {
return 'test'
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test');
})();
// parent class and child class: with literal setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"set": a$set$6, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$6(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}, 'a': {"set": a$set$7, "configurable":true,"enumerable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$7(a) {
GOPD$0(super$0.prototype,'a')["set"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: parent with literal setter, child without literal setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"set": a$set$8, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$set$8(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: with literal static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$6() {
return 'test'
};DPS$0(A,{'a': {"get": static_a$get$6, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$7() {
return GOPD$0(super$0,'a')["get"].call(this, a);
};DPS$0(B,{'a': {"get": static_a$get$7, "configurable":true,"enumerable":true}});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a'] === 'test', B['a'] === 'test');
})();
// parent class and child class: parent with literal static getter, child without literal static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$8() {
return 'test'
};DPS$0(A,{'a': {"get": static_a$get$8, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a'] === 'test', B['a'] === 'test');
})();
// parent class and child class: with literal static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$6(a) {
this._a = a + '_' + 9;
};DPS$0(A,{'a': {"set": static_a$set$6, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$7(a) {
GOPD$0(super$0,'a')["set"].call(this, a);
};DPS$0(B,{'a': {"set": static_a$set$7, "configurable":true,"enumerable":true}});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: parent with literal static setter, child without literal static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$set$8(a) {
this._a = a + '_' + 9;
};DPS$0(A,{'a': {"set": static_a$set$8, "configurable":true,"enumerable":true}});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: with literal getter and setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"get": a$get$9, "set": a$set$9, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$9() {
return this._a;
}
function a$set$9(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}, 'a': {"get": a$get$10, "set": a$set$10, "configurable":true,"enumerable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$10() {
return GOPD$0(super$0.prototype,'a')["get"].call(this, a);
}
function a$set$10(a) {
GOPD$0(super$0.prototype,'a')["set"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: parent with literal getter and setter, child without literal getter and setter
(function() {
var A = (function(){"use strict";function A() {}DPS$0(A.prototype,{'a': {"get": a$get$11, "set": a$set$11, "configurable":true,"enumerable":true}});DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function a$get$11() {
return this._a;
}
function a$set$11(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: with literal static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$9() {
return this._a;
};DPS$0(A,{'a': {"get": static_a$get$9, "set": static_a$set$9, "configurable":true,"enumerable":true}});
function static_a$set$9(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$10() {
return GOPD$0(super$0,'a')["get"].call(this, a);
};DPS$0(B,{'a': {"get": static_a$get$10, "set": static_a$set$10, "configurable":true,"enumerable":true}});
function static_a$set$10(a) {
GOPD$0(super$0,'a')["set"].call(this, a);
}
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B['a'] === 'test_9', B._a === 'test_9', B['a'] === 'test_9');
})();
// parent class and child class: with literal static getter and setter, child without literal static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
function static_a$get$11() {
return this._a;
};DPS$0(A,{'a': {"get": static_a$get$11, "set": static_a$set$11, "configurable":true,"enumerable":true}});
function static_a$set$11(a) {
this._a = a + '_' + 9;
}
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a'] === void 0, B._a === 'test_9', B['a'] === 'test_9');
})();
// --------------------======================== COMPUTED ========================--------------------
var postfix = 'd' + Math.random();
// parent class and child class: with computed method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a' + postfix] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";var $D$6;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
$D$6=('a' + postfix)+'';proto$0[$D$6] = function(a) {
return super$0.prototype['a' + postfix].call(this, a);
};
MIXIN$0(B.prototype,proto$0);proto$0=void 0;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix]() === 'test');
})();
// parent class and child class: parent with computed method, child without computed method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0['a' + postfix] = function(a) {
return 'test'
};
MIXIN$0(A.prototype,proto$0);proto$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix]() === 'test');
})();
// parent class and child class: with computed static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a' + postfix] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var B = (function(super$0){"use strict";var $D$7;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
$D$7=('a' + postfix)+'';static$0[$D$7] = function(a) {
return super$0['a' + postfix].call(this, a);
};
MIXIN$0(B,static$0);static$0=void 0;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a' + postfix]() === 'test', B['a' + postfix]() === 'test');
})();
// parent class and child class: parent with computed static method, child without computed static method
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});var static$0={};
static$0['a' + postfix] = function(a) {
return 'test'
};
MIXIN$0(A,static$0);static$0=void 0;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a' + postfix]() === 'test', B['a' + postfix]() === 'test');
})();
// parent class and child class: with computed getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";var $D$8;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$D$8=('a' + postfix)+'';DP$0(B.prototype,$D$8,{"get":function() {
return GOPD$0(super$0.prototype,'a' + postfix)["get"].call(this);
},"configurable":true,"enumerable":true});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test');
})();
// parent class and child class: parent with computed getter, child without computed getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test');
})();
// parent class and child class: with computed setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";var $D$9;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$D$9=('a' + postfix)+'';DP$0(B.prototype,$D$9,{"set":function(a) {
GOPD$0(super$0.prototype,'a' + postfix)["set"].call(this, a);
},"configurable":true,"enumerable":true});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: parent with computed setter, child without computed setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: with computed static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";var $D$10;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$D$10=('a' + postfix)+'';DP$0(B,$D$10,{"get":function() {
return GOPD$0(super$0,'a' + postfix)["get"].call(this);
},"configurable":true,"enumerable":true});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a' + postfix] === 'test', B['a' + postfix] === 'test');
})();
// parent class and child class: parent with computed static getter, child without computed static getter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"get":function() {
return 'test'
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a' + postfix] === 'test', B['a' + postfix] === 'test');
})();
// parent class and child class: with computed static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";var $D$11;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$D$11=('a' + postfix)+'';DP$0(B,$D$11,{"set":function(a) {
GOPD$0(super$0,'a' + postfix)["set"].call(this, a);
},"configurable":true,"enumerable":true});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A._a === void 0, B._a === 'test_9');
})();
// parent class and child class: parent with computed static setter, child without computed static setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A._a === void 0, B._a === 'test_9');
})();
// parent class and child class: with computed getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A.prototype,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";var $D$12;var $D$13;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$D$12=('a' + postfix)+'';DP$0(B.prototype,$D$12,{"get":function() {
return GOPD$0(super$0.prototype,'a' + postfix)["get"].call(this);
},"configurable":true,"enumerable":true});
$D$13=('a' + postfix)+'';DP$0(B.prototype,$D$13,{"set":function(a) {
GOPD$0(super$0.prototype,'a' + postfix)["set"].call(this, a);
},"configurable":true,"enumerable":true});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: parent with computed getter and setter, child without computed getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A.prototype,'a' + postfix,{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A.prototype,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: with computed static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";var $D$14;var $D$15;function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false});
$D$14=('a' + postfix)+'';DP$0(B,$D$14,{"get":function() {
return GOPD$0(super$0,'a' + postfix)["get"].call(this);
},"configurable":true,"enumerable":true});
$D$15=('a' + postfix)+'';DP$0(B,$D$15,{"set":function(a) {
GOPD$0(super$0,'a' + postfix)["set"].call(this, a);
},"configurable":true,"enumerable":true});
;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B['a' + postfix] === 'test_9', B._a === 'test_9', B['a' + postfix] === 'test_9');
})();
// parent class and child class: with computed static getter and setter, child without computed static getter and setter
(function() {
var A = (function(){"use strict";function A() {}DP$0(A,"prototype",{"configurable":false,"enumerable":false,"writable":false});
DP$0(A,'a' + postfix,{"get":function() {
return this._a;
},"configurable":true,"enumerable":true});
DP$0(A,'a' + postfix,{"set":function(a) {
this._a = a + '_' + 9;
},"configurable":true,"enumerable":true});
;return A;})();
var B = (function(super$0){"use strict";function B() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(B, super$0);if(super$0!==null)SP$0(B,super$0);B.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":B,"configurable":true,"writable":true}});DP$0(B,"prototype",{"configurable":false,"enumerable":false,"writable":false}); ;return B;})(A);
var pk1 = Object.keys(A.prototype);var sk1 = Object.keys(A);
var pk2 = Object.keys(B.prototype);var sk2 = Object.keys(B);
var b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a' + postfix] === void 0, B._a === 'test_9', B['a' + postfix] === 'test_9');
})();

@@ -1,35 +0,1052 @@

class class1 {
constructor(msg) {
this.property1 = msg;
// parent class and child class: without constructor
(function() {
class A {}
class B extends A {}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B();
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B);
})();
// parent class and child class: with constructor
(function() {
class A {
constructor(a) {
this.a = a;
}
}
static sayStatic() { return "[static:class1]" }
class B extends A {
constructor(a) {
super(a);
}
}
say() { return "class1:" + this.property1 }
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B('test');
var super$0;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
class class2 extends class1 {
static sayStatic(){ return super.sayStatic() + "[static:class2]" }
// parent class and child class: parent with constructor, child without constructor
(function() {
class A {
constructor(a) {
this.a = a;
}
}
class B extends A { }
//static A = 123;
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B('test');
constructor({message}) {
super$0 = "test_super";//super variable test
super(message);
this.property2 = message;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
// parent class and child class: with method
(function() {
class A {
a(a) {
return 'test'
}
}
class B extends A {
a(a) {
return super(a);
}
}
say(a = 1, [b] = [2]) {
return super.say() + "|class2" + ":" + this.property2 + "|" + a + "|" + b + ":" + class2.sayStatic();
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b.a() === 'test');
})();
// parent class and child class: parent with method, child without method
(function() {
class A {
a(a) {
return 'test'
}
}
}
class B extends A { }
class class3 extends class1{
say(){return "class3"}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
//console.log(class2.A === 123);
console.log((new class2({message: "test"})).say() === "class1:test|class2:test|1|2:[static:class1][static:class2]")
console.log((new class3()).say() === "class3")
console.log(super$0 === "test_super")
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a() === 'test');
})();
// parent class and child class: with static method
(function() {
class A {
static a(a) {
return 'test'
}
}
class B extends A {
static a(a) {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A.a() === 'test', B.a() === 'test');
})();
// parent class and child class: parent with static method, child without static method
(function() {
class A {
static a(a) {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A.a() === 'test', B.a() === 'test');
})();
// parent class and child class: with getter
(function() {
class A {
get a() {
return 'test'
}
}
class B extends A {
get a() {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
// parent class and child class: parent with getter, child without getter
(function() {
class A {
get a() {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test');
})();
// parent class and child class: with setter
(function() {
class A {
set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
set a(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: parent with setter, child without setter
(function() {
class A {
set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: with static getter
(function() {
class A {
static get a() {
return 'test'
}
}
class B extends A {
static get a() {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A.a === 'test', B.a === 'test');
})();
// parent class and child class: parent with static getter, child without static getter
(function() {
class A {
static get a() {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A.a === 'test', B.a === 'test');
})();
// parent class and child class: with static setter
(function() {
class A {
static set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
static set a(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: parent with static setter, child without static setter
(function() {
class A {
static set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: with getter and setter
(function() {
class A {
get a() {
return this._a;
}
set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
get a() {
return super(a);
}
set a(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test_9', b._a === 'test_9');
})();
// parent class and child class: parent with getter and setter, child without getter and setter
(function() {
class A {
get a() {
return this._a;
}
set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b.a === 'test_9', b._a === 'test_9');
})();
// parent class and child class: with static getter and setter
(function() {
class A {
static get a() {
return this._a;
}
static set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
static get a() {
return super(a);
}
static set a(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A.a === void 0, B._a === 'test_9', B.a === 'test_9');
})();
// parent class and child class: with static getter and setter, child without static getter and setter
(function() {
class A {
static get a() {
return this._a;
}
static set a(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B.a = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A.a === void 0, B._a === 'test_9', B.a === 'test_9');
})();
// --------------------======================== LITERAL ========================--------------------
// parent class and child class: with literal constructor
(function() {
class A {
'constructor'(a) {
this.a = a;
}
}
class B extends A {
'constructor'(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B('test');
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B);
})();
// parent class and child class: parent with literal constructor, child without literal constructor
(function() {
class A {
'constructor'(a) {
this.a = a;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B('test');
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B);
})();
// parent class and child class: with literal method
(function() {
class A {
'a'(a) {
return 'test'
}
}
class B extends A {
'a'(a) {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a']() === 'test');
})();
// parent class and child class: parent with literal method, child without literal method
(function() {
class A {
'a'(a) {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a']() === 'test');
})();
// parent class and child class: with literal static method
(function() {
class A {
static 'a'(a) {
return 'test'
}
}
class B extends A {
static 'a'(a) {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a']() === 'test', B['a']() === 'test');
})();
// parent class and child class: parent with literal static method, child without literal static method
(function() {
class A {
static 'a'(a) {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a']() === 'test', B['a']() === 'test');
})();
// parent class and child class: with literal getter
(function() {
class A {
get 'a'() {
return 'test'
}
}
class B extends A {
get 'a'() {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test');
})();
// parent class and child class: parent with literal getter, child without literal getter
(function() {
class A {
get 'a'() {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test');
})();
// parent class and child class: with literal setter
(function() {
class A {
set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
set 'a'(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: parent with literal setter, child without literal setter
(function() {
class A {
set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: with literal static getter
(function() {
class A {
static get 'a'() {
return 'test'
}
}
class B extends A {
static get 'a'() {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a'] === 'test', B['a'] === 'test');
})();
// parent class and child class: parent with literal static getter, child without literal static getter
(function() {
class A {
static get 'a'() {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a'] === 'test', B['a'] === 'test');
})();
// parent class and child class: with literal static setter
(function() {
class A {
static set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
static set 'a'(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: parent with literal static setter, child without literal static setter
(function() {
class A {
static set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, B._a === 'test_9');
})();
// parent class and child class: with literal getter and setter
(function() {
class A {
get 'a'() {
return this._a;
}
set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
get 'a'() {
return super(a);
}
set 'a'(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: parent with literal getter and setter, child without literal getter and setter
(function() {
class A {
get 'a'() {
return this._a;
}
set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a'] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: with literal static getter and setter
(function() {
class A {
static get 'a'() {
return this._a;
}
static set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A {
static get 'a'() {
return super(a);
}
static set 'a'(a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B['a'] === 'test_9', B._a === 'test_9', B['a'] === 'test_9');
})();
// parent class and child class: with literal static getter and setter, child without literal static getter and setter
(function() {
class A {
static get 'a'() {
return this._a;
}
static set 'a'(a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a'] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a'] === void 0, B._a === 'test_9', B['a'] === 'test_9');
})();
// --------------------======================== COMPUTED ========================--------------------
let postfix = 'd' + Math.random();
// parent class and child class: with computed method
(function() {
class A {
['a' + postfix](a) {
return 'test'
}
}
class B extends A {
['a' + postfix](a) {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix]() === 'test');
})();
// parent class and child class: parent with computed method, child without computed method
(function() {
class A {
['a' + postfix](a) {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix]() === 'test');
})();
// parent class and child class: with computed static method
(function() {
class A {
static ['a' + postfix](a) {
return 'test'
}
}
class B extends A {
static ['a' + postfix](a) {
return super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a' + postfix]() === 'test', B['a' + postfix]() === 'test');
})();
// parent class and child class: parent with computed static method, child without computed static method
(function() {
class A {
static ['a' + postfix](a) {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a' + postfix]() === 'test', B['a' + postfix]() === 'test');
})();
// parent class and child class: with computed getter
(function() {
class A {
get ['a' + postfix]() {
return 'test'
}
}
class B extends A {
get ['a' + postfix]() {
return super();
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test');
})();
// parent class and child class: parent with computed getter, child without computed getter
(function() {
class A {
get ['a' + postfix]() {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test');
})();
// parent class and child class: with computed setter
(function() {
class A {
set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A {
set ['a' + postfix](a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: parent with computed setter, child without computed setter
(function() {
class A {
set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b._a === 'test_9');
})();
// parent class and child class: with computed static getter
(function() {
class A {
static get ['a' + postfix]() {
return 'test'
}
}
class B extends A {
static get ['a' + postfix]() {
return super();
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A['a' + postfix] === 'test', B['a' + postfix] === 'test');
})();
// parent class and child class: parent with computed static getter, child without computed static getter
(function() {
class A {
static get ['a' + postfix]() {
return 'test'
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a' + postfix] === 'test', B['a' + postfix] === 'test');
})();
// parent class and child class: with computed static setter
(function() {
class A {
static set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A {
static set ['a' + postfix](a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, A._a === void 0, B._a === 'test_9');
})();
// parent class and child class: parent with computed static setter, child without computed static setter
(function() {
class A {
static set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A._a === void 0, B._a === 'test_9');
})();
// parent class and child class: with computed getter and setter
(function() {
class A {
get ['a' + postfix]() {
return this._a;
}
set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A {
get ['a' + postfix]() {
return super();
}
set ['a' + postfix](a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 1, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: parent with computed getter and setter, child without computed getter and setter
(function() {
class A {
get ['a' + postfix]() {
return this._a;
}
set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
b['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 1, pk2.length === 0, sk1.length === 0, sk2.length === 0, b instanceof B, b['a' + postfix] === 'test_9', b._a === 'test_9');
})();
// parent class and child class: with computed static getter and setter
(function() {
class A {
static get ['a' + postfix]() {
return this._a;
}
static set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A {
static get ['a' + postfix]() {
return super();
}
static set ['a' + postfix](a) {
super(a);
}
}
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 1, b instanceof B, B['a' + postfix] === 'test_9', B._a === 'test_9', B['a' + postfix] === 'test_9');
})();
// parent class and child class: with computed static getter and setter, child without computed static getter and setter
(function() {
class A {
static get ['a' + postfix]() {
return this._a;
}
static set ['a' + postfix](a) {
this._a = a + '_' + 9;
}
}
class B extends A { }
let pk1 = Object.keys(A.prototype);let sk1 = Object.keys(A);
let pk2 = Object.keys(B.prototype);let sk2 = Object.keys(B);
let b = new B;
B['a' + postfix] = 'test';
console.log(b.constructor == B, b instanceof A, pk1.length === 0, pk2.length === 0, sk1.length === 1, sk2.length === 0, b instanceof B, A['a' + postfix] === void 0, B._a === 'test_9', B['a' + postfix] === 'test_9');
})();

@@ -1,10 +0,10 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};var class1 = (function(){"use strict";var $static$0={},$proto$0={};function class1(msg){this.property1 = msg;}DP$0(class1, "prototype", {"configurable": false, "enumerable": false, "writable": false});;$static$0.sayStatic = function() { return "[static:class1]" };;$proto$0.say = function() { return "class1:" + this.property1 };MIXIN$0(class1,$static$0);MIXIN$0(class1.prototype,$proto$0);$static$0=$proto$0=void 0;return class1;})();
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;var class1 = (function(){"use strict";var static$0={},proto$0={};function class1(msg){this.property1 = msg;}DP$0(class1,"prototype",{"configurable":false,"enumerable":false,"writable":false});;static$0.sayStatic = function() { return "[static:class1]" };;proto$0.say = function() { return "class1:" + this.property1 };MIXIN$0(class1,static$0);MIXIN$0(class1.prototype,proto$0);static$0=proto$0=void 0;return class1;})();
var super$0;
var class2 = (function(super$1){"use strict";MIXIN$0(class2, super$1);var $static$0={},$proto$0={};$static$0.sayStatic = function(){ return super$1.sayStatic() + "[static:class2]" };;function class2(message) {var message = message.message;super$0="test_super";super$1.call(this, message);this.property2 = message;}class2.prototype = Object.create(super$1.prototype, {"constructor": {"value": class2, "configurable": true, "writable": true} });DP$0(class2, "prototype", {"configurable": false, "enumerable": false, "writable": false});;$proto$0.say = function() {var S_ITER$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol.iterator||'@@iterator';var S_MARK$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol["__setObjectSetter__"];function ITER$0(v,f){if(v){if(Array.isArray(v))return f?v.slice():v;var i,r;if(S_MARK$0)S_MARK$0(v);if(typeof v==='object'&&typeof (f=v[S_ITER$0])==='function'){i=f.call(v);r=[];}else if((v+'')==='[object Generator]'){i=v;r=[];};if(S_MARK$0)S_MARK$0(void 0);if(r) {while((f=i['next']()),f['done']!==true)r.push(f['value']);return r;}}throw new Error(v+' is not iterable')};var a = arguments[0];if(a === void 0)a = [1];var b = arguments[1];if(b === void 0)b = [2];var arr = arguments[2];if(arr === void 0)arr = [ ].concat(ITER$0(a), ITER$0(b));return super$1.prototype.say.call(this) + "|arr:" + arr.join();};MIXIN$0(class2,$static$0);MIXIN$0(class2.prototype,$proto$0);$static$0=$proto$0=void 0;return class2;})(class1);
var class2 = (function(super$1){"use strict";if(!PRS$0)MIXIN$0(class2, super$1);var static$0={},proto$0={};static$0.sayStatic = function(){ return super$1.sayStatic.call(this) + "[static:class2]" };;function class2(message) {var message = message.message;super$0="test_super";super$1.call(this, message);this.property2 = message;}if(super$1!==null)SP$0(class2,super$1);class2.prototype = OC$0(super$1!==null?super$1.prototype:null,{"constructor":{"value":class2,"configurable":true,"writable":true}});DP$0(class2,"prototype",{"configurable":false,"enumerable":false,"writable":false});;proto$0.say = function() {var S_ITER$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol.iterator||'@@iterator';var S_MARK$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol["__setObjectSetter__"];function ITER$0(v,f){if(v){if(Array.isArray(v))return f?v.slice():v;var i,r;if(S_MARK$0)S_MARK$0(v);if(typeof v==='object'&&typeof (f=v[S_ITER$0])==='function'){i=f.call(v);r=[];}else if((v+'')==='[object Generator]'){i=v;r=[];};if(S_MARK$0)S_MARK$0(void 0);if(r) {while((f=i['next']()),f['done']!==true)r.push(f['value']);return r;}}throw new Error(v+' is not iterable')};var a = arguments[0];if(a === void 0)a = [1];var b = arguments[1];if(b === void 0)b = [2];var arr = arguments[2];if(arr === void 0)arr = [ ].concat(ITER$0(a), ITER$0(b));return super$1.prototype.say.call(this) + "|arr:" + arr.join();};MIXIN$0(class2,static$0);MIXIN$0(class2.prototype,proto$0);static$0=proto$0=void 0;return class2;})(class1);
var class3 = (function(super$1){"use strict";function class3() {super$1.apply(this, arguments)}MIXIN$0(class3, super$1);class3.prototype = Object.create(super$1.prototype, {"constructor": {"value": class3, "configurable": true, "writable": true} });DP$0(class3, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};
$proto$0.say = function(){return "class3"};
MIXIN$0(class3.prototype,$proto$0);$proto$0=void 0;return class3;})(class1);
var class3 = (function(super$1){"use strict";function class3() {super$1.apply(this, arguments)}if(!PRS$0)MIXIN$0(class3, super$1);if(super$1!==null)SP$0(class3,super$1);class3.prototype = OC$0(super$1!==null?super$1.prototype:null,{"constructor":{"value":class3,"configurable":true,"writable":true}});DP$0(class3,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};
proto$0.say = function(){return "class3"};
MIXIN$0(class3.prototype,proto$0);proto$0=void 0;return class3;})(class1);

@@ -11,0 +11,0 @@

@@ -1,3 +0,3 @@

var DP$0 = Object.defineProperty;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,Object.getOwnPropertyDescriptor(s,p));}}return t};var class1 = (function(){"use strict";function class1(opts){this.class1=1;this.op1=opts.op1}DP$0(class1, "prototype", {"configurable": false, "enumerable": false, "writable": false});;return class1;})();
var class2 = (function(super$0){"use strict";function class2() {super$0.apply(this, arguments)}MIXIN$0(class2, super$0);class2.prototype = Object.create(super$0.prototype, {"constructor": {"value": class2, "configurable": true, "writable": true} });DP$0(class2, "prototype", {"configurable": false, "enumerable": false, "writable": false});var $proto$0={};$proto$0.say = function(){return "class2"};MIXIN$0(class2.prototype,$proto$0);$proto$0=void 0;return class2;})(class1);
var PRS$0 = (function(o,t){o["__proto__"]={"a":t};return o["a"]===t})({},{});var DP$0 = Object.defineProperty;var GOPD$0 = Object.getOwnPropertyDescriptor;var MIXIN$0 = function(t,s){for(var p in s){if(s.hasOwnProperty(p)){DP$0(t,p,GOPD$0(s,p));}}return t};var class1 = (function(){"use strict";function class1(opts){this.class1=1;this.op1=opts.op1}DP$0(class1,"prototype",{"configurable":false,"enumerable":false,"writable":false});;return class1;})();
var class2 = (function(super$0){"use strict";var SP$0 = Object.setPrototypeOf||function(o,p){o["__proto__"]=p;return o};var OC$0 = Object.create;function class2() {super$0.apply(this, arguments)}if(!PRS$0)MIXIN$0(class2, super$0);if(super$0!==null)SP$0(class2,super$0);class2.prototype = OC$0(super$0!==null?super$0.prototype:null,{"constructor":{"value":class2,"configurable":true,"writable":true}});DP$0(class2,"prototype",{"configurable":false,"enumerable":false,"writable":false});var proto$0={};proto$0.say = function(){return "class2"};MIXIN$0(class2.prototype,proto$0);proto$0=void 0;return class2;})(class1);

@@ -4,0 +4,0 @@ var a = new class2({op1: 99});

@@ -1,2 +0,2 @@

var DP$0 = Object.defineProperty;var DPS$0 = Object.defineProperties;var GOPDS_P$0 = Object.getOwnPropertyDescriptors||function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]={"value":o[p],"enumerable":true,"configurable":true,"writable":true};}return d;};var GOPDS_A$0 = function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]=o[p];}return d;};
var DP$0 = Object.defineProperty;var DPS$0 = Object.defineProperties;var GOPDS_P$0 = function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]={"value":o[p],"enumerable":true,"configurable":true,"writable":true};}return d;};var GOPDS_A$0 = function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]=o[p];}return d;};
{// one property

@@ -3,0 +3,0 @@ {// simple

@@ -1,2 +0,2 @@

var DP$0 = Object.defineProperty;var DPS$0 = Object.defineProperties;var GOPDS_P$0 = Object.getOwnPropertyDescriptors||function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]={"value":o[p],"enumerable":true,"configurable":true,"writable":true};}return d;};var GOPDS_A$0 = function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]=o[p];}return d;};
var DP$0 = Object.defineProperty;var DPS$0 = Object.defineProperties;var GOPDS_P$0 = function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]={"value":o[p],"enumerable":true,"configurable":true,"writable":true};}return d;};var GOPDS_A$0 = function(o){var d=Object.create(null);for(var p in o)if(o.hasOwnProperty(p)){d[p]=o[p];}return d;};
var a = DP$0({}, 'x',{"value": function () { return 123 },"configurable":true,"enumerable":true,"writable":true} );

@@ -3,0 +3,0 @@ console.log(a['x']() === 123);

@@ -33,1 +33,11 @@ var S_ITER$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol.iterator||'@@iterator';var S_MARK$0 = typeof Symbol!=='undefined'&&Symbol&&Symbol["__setObjectSetter__"];function ITER$0(v,f){if(v){if(Array.isArray(v))return f?v.slice():v;var i,r;if(S_MARK$0)S_MARK$0(v);if(typeof v==='object'&&typeof (f=v[S_ITER$0])==='function'){i=f.call(v);r=[];}else if((v+'')==='[object Generator]'){i=v;r=[];};if(S_MARK$0)S_MARK$0(void 0);if(r) {while((f=i['next']()),f['done']!==true)r.push(f['value']);return r;}}throw new Error(v+' is not iterable')};function testSequenceExpression1(a, b, c, d) {

}
{//#43: spread and arrow
var arr$0 = [1, 2, 3];
var func = function(a, b, c) {
return [a, b, c];
}
var result = func.apply(null, [function() {return true}].concat(ITER$0(arr$0) ));
}

@@ -32,2 +32,12 @@ function testSequenceExpression1(a, b, c, d) {

console.log(T.join("|") == [1, 1, 1].join("|"))
}
}
{//#43: spread and arrow
let arr = [1, 2, 3];
let func = function(a, b, c) {
return [a, b, c];
}
let result = func( () => true, ...arr );
}

@@ -6,5 +6,12 @@ "use strict";

function isIdentifier(node) {
return node && node.type === "Identifier";
function isIdentifier(node, name) {
return node
&& node.type === "Identifier"
&& (!name || node.name == name)
;
}
function isMemberExpression(node) {
return node && node.type === "MemberExpression";
}
function isClass(node) {

@@ -14,43 +21,48 @@ return node && (node.type === "ClassDeclaration" || node.type === "ClassExpression")

const $defineProperty = "Object.defineProperty";
const objectMixinBody =
"function(t,s){"
+ "for(var p in s){"
+ "if(s.hasOwnProperty(p)){"
+ "${Object_defineProperty}(t,p,Object.getOwnPropertyDescriptor(s,p));"
+ "}"
+ "}"
+ "return t}"
;
function isHoistFunction(node) {
let type;
return node && (type = node.type)
&& (type === "FunctionDeclaration" || type === "FunctionExpression");
}
const classesTranspiler = {
reset: function() {
this.__currentClassMethodsStatic = null;
this.__currentClassName = null;
this.__superRefName = null;
this.__protoRefName = null;
this.__staticRefName = null;
this.__currentAccessors = null;
this.__currentStaticAccessors = null;
this.__currentFirstStaticAccessor = null;
function isLiteral(node) {
let type;
return node && (type = node.type)
&& (type === "Literal");
}
this.__staticPropertiesCount = 0;
this.__protoPropertiesCount = 0;
}
const GET_CNAMES = "function f(o){" +
"var r,u;for(var p in o)if((r=o[p])&&typeof r ==='object'&&(u=r[\"__unq\"])){" +
"${getCNames_names}[u]=p;" +
"delete r[\"__unq\"];" +
"}" +
"return o;" +
"};";
, createNames: function(node) {
// We need only one unique name for the entire file
function literalToName(string) {
let firstChar = string.charAt(0), lastChar = string.charAt(string.length - 1);
let isLiteral = (firstChar === '\'' || firstChar === '\"')
&& (lastChar === '\'' || lastChar === '\"')
;
if( !this.__superRefName ) {
this.__superRefName = core.unique("super", true);
}
if( !this.__protoRefName ) {
this.__protoRefName = core.unique("$proto", true);
}
if( !this.__staticRefName ) {
this.__staticRefName = core.unique("$static", true);
}
if ( isLiteral ) {
return string.substring(1, string.length - 1);
}
return string;
}
this.__DP = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
this.__MIXIN = core.bubbledVariableDeclaration(node.$scope, "MIXIN", objectMixinBody.replace("${Object_defineProperty}", this.__DP));
const classesTranspiler = {
reset: function() {
this.__statistic = {
staticCount: 0
, protoCount: 0
, flexibleNamesCount: 0
};
this.__current = {
method: null
, name: ''
, accessors: {}
, staticAccessors: {}
, firstStaticAccessors: null
};
}

@@ -64,31 +76,75 @@

core.registerVar('super', {persistent: true});
// core.registerVar('super_prototype', {persistent: true});
core.registerVar('static', {persistent: true});
core.registerVar('proto', {persistent: true});
core.registerVar('getCNames_names', {name: 'CNAMES', template: '[]'});
core.registerVar('getCNames', {name: 'GET_CNAMES', template: GET_CNAMES, deps: ['getCNames_names']});
this.alter = alter;
}
, createPrototypeString: function(node, className, superName, accessors) {
const accessorsKeys = Object.keys(accessors);
, accessorsDefinition: function(node, accessors) {
let accessorsKeys = Object.keys(accessors);
let accessorsFlexibleName = false;
const accessorsString = accessorsKeys.map(function(key) {
let accessor = accessors[key];
let raw = accessor.raw, getter = accessor.get, setter = accessor.set;
return (raw || key) + ": {" + (getter ? "\"get\": " + getter + ", " : "") + (setter ? "\"set\": " + setter + ", " : "") + "\"configurable\": true, \"enumerable\": true}"
} ).join(", ");
let result = {
objectWrapper: ''
, main: ''
, afterAll: ''
};
let Object_defineProperty_name = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
const freezePrototypeString = Object_defineProperty_name + "(" + className + ", \"prototype\", {\"configurable\": false, \"enumerable\": false, \"writable\": false});";
if ( accessorsKeys.length ) {
result.main = accessorsKeys.map(function(key) {
let accessor = accessors[key];
let raw = accessor.raw
, getter = accessor.get
, setter = accessor.set
, isFlexibleName = !!accessor.$nameForSuper
, uniqueId
;
if ( isFlexibleName ) {
accessorsFlexibleName = isFlexibleName;
uniqueId = ++this.__statistic.flexibleNamesCount;
let nameForSuper = accessor.$nameForSuper;
let namesVar = core.createVars(node, "getCNames_names");
result.afterAll += (nameForSuper + '=' + namesVar + '[' + uniqueId + '];delete ' + namesVar + '[' + uniqueId + '];');
}
return (raw || key)
+ ": {" + (getter ? "\"get\": " + getter + ", " : "") + (setter ? "\"set\": " + setter + ", " : "") + "\"configurable\":true,\"enumerable\":true"
+ (isFlexibleName ? ', "__unq": ' + uniqueId : '')
+ "}"
}, this).join(", ");
if ( accessorsFlexibleName ) {
result.objectWrapper = core.createVars(node, "getCNames");
}
}
return result;
}
, createPrototypeString: function(node, className, superName, accessors) {
const freezePrototypeString =
core.createVars(node, "defineProperty")
+ "(" + className + ",\"prototype\",{\"configurable\":false,\"enumerable\":false,\"writable\":false});";
if ( superName ) {
return className
+ ".prototype = Object.create(" + superName + ".prototype"
+ ", {"
+ "\"constructor\": {\"value\": " + className + ", \"configurable\": true, \"writable\": true}"
+ (accessorsString ? ", " + accessorsString : "")
+ " }"
+ ");"
let names = core.createVars(node, {setPrototypeOf: true/*, "super_prototype": true*/});
return "if(" + superName + "!==null)" + names.setPrototypeOf + "(" + className + "," + superName + ");"
+ className + ".prototype = "
+ this.createAccessorsDefinitionString(node, className, accessors, true, superName)
+ freezePrototypeString
;
}
else if ( accessorsString ) {
return "Object.defineProperties("
+ className + ".prototype, {" + accessorsString + "});"
else if ( Object.keys(accessors).length ) {
return this.createAccessorsDefinitionString(node, className + ".prototype", accessors)
+ freezePrototypeString

@@ -102,14 +158,33 @@ ;

, createStaticAccessorsDefinitionString: function(node, recipientStr, accessors) {
let accessorsKeys = Object.keys(accessors);
, createAccessorsDefinitionString: function(node, recipientStr, accessors, createMode, superName) {
const accessorsDefinition = this.accessorsDefinition(node, accessors);
if ( !accessorsKeys.length ) {
return "";
assert(!createMode || superName);
const accessorsString = accessorsDefinition.main;
if ( !accessorsString && !createMode ) {
return '';
}
const beforeObject = accessorsDefinition.objectWrapper ? accessorsDefinition.objectWrapper + '(' : '';
const afterObject = accessorsDefinition.objectWrapper ? ')' : '';
const afterAll = accessorsDefinition.afterAll ? accessorsDefinition.afterAll + ';' : '';
return ";Object.defineProperties(" + recipientStr + ", {" + accessorsKeys.map(function(key) {
let accessor = accessors[key];
let raw = accessor.raw, getter = accessor.get, setter = accessor.set;
return (raw || key) + ": {" + (getter ? "\"get\": " + getter + ", " : "") + (setter ? "\"set\": " + setter : "") + ", \"configurable\": true, \"enumerable\": true}"
} ).join(", ") + "});";
let funcName = core.createVars(node, createMode ? 'create' : 'defineProperties');
return funcName
+ "("
+ (createMode ? superName + "!==null?" + superName + ".prototype:null" : recipientStr)
+ ","
+ beforeObject
+ "{"
+ (createMode
? "\"constructor\":{\"value\":" + recipientStr + ",\"configurable\":true,\"writable\":true}"
+ (accessorsString ? ", " + accessorsString : "")
: accessorsString
)
+ "}"
+ afterObject
+ ");"
+ afterAll
;
}

@@ -119,4 +194,2 @@

{
this.createNames(node);
const isClassExpression = node.type === 'ClassExpression'

@@ -130,3 +203,2 @@ , nodeId = node.id

, currentClassName = nodeId ? nodeId.name : core.unique("constructor", true)
, SUPER_NAME = this.__superRefName
, useStrictString = node.strictMode ? "" : "\"use strict\";"

@@ -142,6 +214,6 @@ ;

let objectMixinFunctionName = this.__MIXIN;
let names = core.createVars(node, {"super": !!superClass, __proto__support: !!superClass, MIXIN: true});
node["$ClassName"] = currentClassName;
this.__currentClassName = currentClassName;
this.__current.name = currentClassName;

@@ -153,6 +225,7 @@ let classStr = (isClassExpression ? "(" : "var " + currentClassName + " = ")

if( superClass ) {
classStr += SUPER_NAME;
superClass = isIdentifier(superClass) ? superClass.name : this.alter.get(superClass.range[0], superClass.range[1]);
classStr += names.super;
insertAfterBodyBegin_string = objectMixinFunctionName + "(" + currentClassName + ", " + SUPER_NAME + ");";
insertAfterBodyBegin_string =
'if(!' + names.__proto__support + ')'
+ names.MIXIN + "(" + currentClassName + ", " + names.super + ");";
}

@@ -164,7 +237,14 @@

classConstructor = classBodyNodes[i];
if( classConstructor.type !== "MethodDefinition" ) {
classConstructor = null;
}
else if( classConstructor.key.name !== "constructor" ) {
classConstructor = null;
else {
let nodeKey = classConstructor.key;
let _isLiteral = isLiteral(nodeKey);
let methodName = _isLiteral ? nodeKey.value : nodeKey.name;
if( methodName !== "constructor" ) {
classConstructor = null;
}
}

@@ -177,12 +257,13 @@ }

this.__currentAccessors = {};
this.__currentStaticAccessors = {};
this.__current.accessors = {};
this.__current.staticAccessors = {};
if( classBodyNodesCount ) {
for ( let i = 0 ; i < classBodyNodesCount ; i++ ) {
this.replaceClassMethods(classBodyNodes[i], astQuery);
this.replaceClassMethods(this.__current.method = classBodyNodes[i], astQuery);
this.__current.method = null;
}
}
extendedClassConstructorPostfix = this.createPrototypeString(node, currentClassName, superClass && SUPER_NAME, this.__currentAccessors);
let staticAccessorsDefinitionString = this.createStaticAccessorsDefinitionString(node, currentClassName, this.__currentStaticAccessors);
extendedClassConstructorPostfix = this.createPrototypeString(node, currentClassName, superClass && names.super, this.__current.accessors);
let staticAccessorsDefinitionString = this.createAccessorsDefinitionString(node, currentClassName, this.__current.staticAccessors);

@@ -195,8 +276,10 @@ if( classConstructor ) {

astQuery.traverse(classConstructor, this.replaceClassConstructorSuper);
astQuery.traverse(classConstructor, this.replaceClassMethodSuperInConstructor);
this.__current.method = classConstructor.value;
astQuery.traverse(classConstructor.value.body, this.replaceClassConstructorSuper);
astQuery.traverse(classConstructor.value.body, this.replaceClassMethodSuperInConstructor);
this.__current.method = null;
}
else {
insertAfterBodyBegin_string = "function " + currentClassName + "() {"
+ (superClass ? SUPER_NAME + ".apply(this, arguments)" : "")
+ (superClass ? names.super + ".apply(this, arguments)" : "")
+ "}" + (insertAfterBodyBegin_string || "") + (extendedClassConstructorPostfix || "");

@@ -206,9 +289,15 @@ }

let theEndString = '', tmpVars = [];
if ( this.__staticPropertiesCount ) {
theEndString += (objectMixinFunctionName + '(' + currentClassName + ',' + this.__staticRefName + ');')
tmpVars.push(this.__staticRefName);
if ( this.__statistic.staticCount ) {
let staticName = core.createVars(node, "static");
theEndString += (names.MIXIN + '(' + currentClassName + ',' + staticName + ');')
tmpVars.push(staticName);
}
if ( this.__protoPropertiesCount ) {
theEndString += (objectMixinFunctionName + '(' + currentClassName + '.prototype,' + this.__protoRefName + ');')
tmpVars.push(this.__protoRefName);
if ( this.__statistic.protoCount ) {
let protoName = core.createVars(node, "proto");
theEndString += (names.MIXIN + '(' + currentClassName + '.prototype,' + protoName + ');')
tmpVars.push(protoName);
}

@@ -224,3 +313,3 @@ if ( tmpVars.length ) {

if ( staticAccessorsDefinitionString ) {
this.alter.insertAfter(this.__currentFirstStaticAccessor.range[1], staticAccessorsDefinitionString);
this.alter.insertAfter(this.__current.firstStaticAccessors.range[1], ';' + staticAccessorsDefinitionString);
}

@@ -234,24 +323,57 @@

this.alter.insert(node.range[1],
")(" + (superClass || "") + ")"
+ (isClassExpression ? ")" : ";")//tail ')' or semicolon
);
if ( superClass ) {
superClass = isIdentifier(superClass) ? superClass.name : this.alter.get(superClass.range[0], superClass.range[1]);
this.__currentClassName = null;
this.__staticPropertiesCount = 0;
this.__protoPropertiesCount = 0;
this.alter.insert(node.range[1],
")(" + superClass + ")"
+ (isClassExpression ? ")" : ";")//tail ')' or semicolon
);
}
else {
this.alter.insert(node.range[1],
")()" + (isClassExpression ? ")" : ";")//tail ')' or semicolon
);
}
this.reset();
}
}
, unwrapSuperCall: function unwrapSuperCall(node, calleeNode, isStatic, property, isConstructor) {
let superRefName = this.__superRefName;
assert(superRefName);
, unwrapSuperCall: function unwrapSuperCall(node, calleeNode, rootMethod, isConstructor) {
assert(!calleeNode.$originalName);
let changeStr = superRefName + (isStatic ? "" : ".prototype");
var superName = core.createVars(node, "super");
let isStatic = rootMethod.static;
let isAccessor = rootMethod.kind === 'get' || rootMethod.kind === 'set';
let changeStr = superName + (isStatic || isConstructor ? "" : ".prototype");
let callArguments = node.arguments;
let hasSpreadElement = !isStatic && callArguments.some(function(node){ return node.type === "SpreadElement" });
let hasSpreadElement = callArguments.some(function(node){ return node.type === "SpreadElement" });
let name = '', access = '';
if ( !isConstructor ) {
if ( name = rootMethod.$nameForSuper ) {
access = '[' + name + ']';
}
else {
name = core.PropertyToString(rootMethod.key, true);
}
}
if ( isAccessor ) {
changeStr = core.createVars(node, 'getOwnPropertyDescriptor')
+ '(' + changeStr + ',' + name + ')[\"' + rootMethod.kind + '\"]'
}
else {
if ( !isConstructor && !access && (!hasSpreadElement || !rootMethod.$__hasName) ) {
access = core.PropertyToString(rootMethod.key);
}
changeStr += access;
}
calleeNode.$originalName = calleeNode.name;
calleeNode.name = superName;
let changesEnd;
if( (!isStatic || isConstructor) && !hasSpreadElement ) {
changeStr += (property ? "." + property.name : "");
if( !hasSpreadElement ) {

@@ -266,9 +388,10 @@ if( !callArguments.length ) {

}
// text change 'super$0.call(this, <some>)'
this.alter.replace(calleeNode.range[0], changesEnd, changeStr);
}
else {
changesEnd = calleeNode.range[1];
// text change 'super(<some>)' => 'super$0(<some>)'
this.alter.replace(calleeNode.range[0], calleeNode.range[1], changeStr);
}
// text change 'super(<some>)' => 'super$0(<some>)' (if <some> contains SpreadElement) or 'super$0.call(this, <some>)'
this.alter.replace(calleeNode.range[0], changesEnd, changeStr);
}

@@ -280,7 +403,8 @@

if( calleeNode && isIdentifier(calleeNode) && calleeNode.name === "super" ) {
this.unwrapSuperCall(node, calleeNode, true, null, true);
if( calleeNode && isIdentifier(calleeNode) && calleeNode.name === 'super' ) {
this.unwrapSuperCall(node, calleeNode, this.__current.method, true);
}
}
else if( isClass(node) ) {
else if( isClass(node) || isHoistFunction(node) ) {
return false;

@@ -291,15 +415,61 @@ }

, replaceClassMethods: function replaceClassMethods(node, astQuery) {
if( node.type === "MethodDefinition" && node.key.name !== "constructor" ) {
let isStatic = this.__currentClassMethodsStatic = node.static;
let nodeKey = node.key;
let _isLiteral = isLiteral(nodeKey);
let methodName = core.PropertyToString(nodeKey, true);
if( node.type === "MethodDefinition" && (_isLiteral ? nodeKey.value : nodeKey.name) !== "constructor" ) {
let isStatic = node.static;
let isComputed = node.computed;
let nodeKey = node.key;
let keyRange = isComputed ? nodeKey.bracesRange : nodeKey.range;
if( node.kind === "set" || node.kind === "get" ) {
this.__namedSuperCount = 0;
this.__unNamedSuperCount = 0;
astQuery.traverse(node.value.body, function(child) {
if( child.type === "CallExpression" ) {
child = child.callee;
if( isMemberExpression(child) ) {
let objectNode = child.object;
if( isIdentifier(objectNode) && objectNode.name === 'super' ) {
this.__namedSuperCount++;
node.$hasSuperInside = true;
}
}
else if ( isIdentifier(child) && child.name === 'super' ) {
this.__unNamedSuperCount++;
node.$hasSuperInside = true;
}
}
else if( isClass(child) || isHoistFunction(child) ) {
return false;
}
}.bind(this));
let unNamedSuperCount = this.__unNamedSuperCount;
if( node.kind === 'set' || node.kind === 'get' ) {
if ( isComputed ) {
let targetName = isStatic === true ? this.__currentClassName : this.__currentClassName + '.prototype';
let targetName = isStatic === true ? this.__current.name : this.__current.name + '.prototype';
// get [<name>]() -> DP$0(<className>.prototype,<name>,
this.alter.replace(node.range[0], nodeKey.bracesRange[0] + 1, this.__DP + '(' + targetName + ',');
if ( unNamedSuperCount ) {
methodName = core.getScopeTempVar(node, node.$scope);
// get [<name>]() -> $D$0=(<name>]()
this.alter.replace(node.range[0], nodeKey.bracesRange[0] + 1, methodName + '=(');
// $D$0=(<name>]() -> $D$0=(<name>)+'';DP$0(<className>.prototype,$D$0,
this.alter.insert(
nodeKey.range[1]
, ')+\'\';' + core.createVars(node, 'defineProperty') + '(' + targetName + ',' + methodName
);
}
else {
// get [<name>]() -> DP$0(<className>.prototype,<name>,
this.alter.replace(
node.range[0]
, nodeKey.bracesRange[0] + 1
, core.createVars(node, 'defineProperty') + '(' + targetName + ','
);
}
this.alter.replace(nodeKey.range[1], nodeKey.bracesRange[1], ',{"' + node.kind + '":function');

@@ -310,27 +480,29 @@

}
else {// TODO:: make is easiest
if ( isStatic && !this.__currentFirstStaticAccessor ) {
this.__currentFirstStaticAccessor = node;
else {
if ( isStatic && !this.__current.firstStaticAccessors ) {
this.__current.firstStaticAccessors = node;
}
let isLiteral = nodeKey.type == 'Literal';
assert(isIdentifier(nodeKey) || isLiteral);
assert(isIdentifier(nodeKey) || _isLiteral);
let name;
if ( isLiteral ) {
name = nodeKey.value;
}
else {
name = nodeKey.name;
}
let key = literalToName(methodName);
let accessor = isStatic === true
? this.__currentStaticAccessors[name] || (this.__currentStaticAccessors[name] = {})
: this.__currentAccessors[name] || (this.__currentAccessors[name] = {})
? this.__current.staticAccessors[key] || (this.__current.staticAccessors[key] = {})
: this.__current.accessors[key] || (this.__current.accessors[key] = {})
;
let replacement = accessor[node.kind] = core.unique((isStatic ? "static_" : "") + name + "$" + node.kind, true);
accessor.node = node;
let replacement = accessor[node.kind] =
core.unique((isStatic ? "static_" : "") + key + "$" + node.kind, true)
;
if ( isLiteral ) {
if ( _isLiteral ) {
accessor.raw = nodeKey.raw;
}
else if ( node.$hasSuperInside ) {
if ( !accessor.$nameForSuper ) {
accessor.$nameForSuper = core.getScopeTempVar(node, node.$scope);
}
node.$nameForSuper = accessor.$nameForSuper;
}

@@ -343,19 +515,38 @@ this.alter.replace(node.range[0], nodeKey.range[1], "function " + replacement);

if ( isStatic ) {
this.__staticPropertiesCount++;
this.__statistic.staticCount++;
}
else {
this.__protoPropertiesCount++;
this.__statistic.protoCount++;
}
let targetName = isStatic === true ? this.__staticRefName : this.__protoRefName;
let targetName = core.createVars(node, isStatic === true ? 'static' : 'proto');
if ( isStatic ) {
// text change 'static method(<something>)' => '$static$0.method(<something>)'
// text change 'static [method](<something>)' => '$static$0[method](<something>)'
this.alter.replace(node.range[0], keyRange[0], targetName + (isComputed ? '' : '.'));
if ( unNamedSuperCount && isComputed ) {
methodName = core.getScopeTempVar(node, node.$scope);
// text change 'static ['method' + i++](<something>)' => '$D$0=('method' + i++) + '';$static$0[$D$0](<something>)'
// text change '['method' + i++](<something>)' => '$D$0='method' + i++;$proto$0[$D$0](<something>)'
// [<name>]() -> $D$0=<name>]() or [<name>]() -> $D$0=(<name>]()
this.alter.replace(node.range[0], nodeKey.bracesRange[0] + 1, methodName + '=(');
// $D$0=(<name>]() -> $D$0=(<name>)+'';$proto$0[$D$0]()
this.alter.insertBefore(nodeKey.range[1], ')+\'\';' + targetName + '[' + methodName);
}
else {
// text change 'method(<something>)' => '$proto$0.method(<something>)'
// text change '[method](<something>)' => '$proto$0[method](<something>)'
this.alter.insert(node.range[0], targetName + (isComputed ? '' : '.'));
let beforeName = _isLiteral && !isComputed ? '[' : (isComputed ? '' : '.');
let afterName = _isLiteral && !isComputed ? ']' : '';
if ( isStatic ) {
// text change 'static method(<something>)' => '$static$0.method(<something>)'
// text change 'static [method](<something>)' => '$static$0[method](<something>)'
this.alter.replace(node.range[0], keyRange[0], targetName + beforeName);
}
else {
// text change 'method(<something>)' => '$proto$0.method(<something>)'
// text change '[method](<something>)' => '$proto$0[method](<something>)'
this.alter.insert(node.range[0], targetName + beforeName);
}
if ( afterName ) {
this.alter.insert(keyRange[1], afterName);
}
}

@@ -369,5 +560,5 @@

astQuery.traverse(node.value, this.replaceClassMethodSuper);
node.$nameForSuper = node.$nameForSuper/* || methodName*/;
astQuery.traverse(node.value.body, this.replaceClassMethodSuper);
}
this.__currentClassMethodsStatic = null;
}

@@ -377,15 +568,33 @@

if( node.type === "CallExpression" ) {
assert(typeof this.__currentClassMethodsStatic === "boolean");
let calleeNode = node.callee;
if( calleeNode && calleeNode.type === "MemberExpression" ) {
if( isMemberExpression(calleeNode) ) {
let objectNode = calleeNode.object;
if( objectNode && isIdentifier(objectNode) && objectNode.name === "super" ) {
if( isIdentifier(objectNode, 'super') ) {
// text change 'super.method(<some>)' => 'super$0(<some>)' (if <some> contains SpreadElement) or 'super$0.call(this, <some>)'
this.unwrapSuperCall(node, objectNode, this.__currentClassMethodsStatic, calleeNode.property);
this.unwrapSuperCall(node, objectNode, {
key: calleeNode.property
, $__hasName: true
, static: this.__current.method.static
, computed: this.__current.method.computed
});
return false;
}
}
else if ( isIdentifier(calleeNode, 'super') ) {
// text change 'super(<some>)' => 'super$0[<superMethodName>](<some>)' (if <some> contains SpreadElement) or 'super$0[<superMethodName>].call(this, <some>)'
this.unwrapSuperCall(node, calleeNode, this.__current.method);
}
}
else if( isClass(node) ) {
else if( isIdentifier(node, 'super') ) {
if ( !node.$originalName ) {
node.$originalName = node.name;
node.name = core.createVars(node, "super");
this.alter.replace(node.range[0], node.range[1], node.name);
}
}
else if( isClass(node) || isHoistFunction(node) ) {
return false;

@@ -396,3 +605,3 @@ }

, replaceClassMethodSuperInConstructor: function replaceClassMethodSuperInConstructor(node) {
if( isIdentifier(node) && node.name === "super" ) {
if( isIdentifier(node, 'super') ) {
let parent = node.$parent;

@@ -406,5 +615,5 @@ if ( parent.type === 'CallExpression' ) {

// text change 'super.a(<some>)' => 'super$0.a(<some>)'
this.alter.replace(node.range[0], node.range[1], this.__superRefName);
this.alter.replace(node.range[0], node.range[1], core.createVars(node, 'super'));
}
else if( isClass(node) ) {
else if( isClass(node) || isHoistFunction(node) ) {
return false;

@@ -411,0 +620,0 @@ }

@@ -12,2 +12,14 @@ /*globals require, module*/

function extend(target) {
for ( let i = 1, len = arguments.length ; i < len ; i++ ) {
let source = arguments[i];
for ( let key in source ) if ( source.hasOwnProperty(key) ) {
target[key] = source[key];
}
}
return target;
}
function getline(node) {

@@ -65,2 +77,8 @@ return node.loc.start.line;

function isMethodDefinition(node) {
let type;
return node && (type = node.type)
&& (type === "MethodDefinition");
}
function isNonFunctionBlock(node) {

@@ -120,3 +138,3 @@ return node && node.type === "BlockStatement" && !isFunction(node.$parent);

let core = module.exports = {
let core = module.exports = extend({}, require('./core/standardVars.js'), {
reset: function() {

@@ -668,7 +686,14 @@ this.allIdentifiers = stringset();

, PropertyToString: function(node) {
let isParentComputedProperty = node && isProperty(node.$parentNode) && node.$parentNode.computed;
, PropertyToString: function(node, justName) {
let isParentComputedProperty = node
&& (isProperty(node.$parentNode) || isMethodDefinition(node.$parentNode))
&& node.$parentNode.computed
;
let _dot = justName ? '' : '.';
let _computedBefore = justName ? '' : '[';
let _computedAfter = justName ? '' : ']';
if ( isParentComputedProperty ) {
return "[" + this.alter.get(node.range[0], node.range[1]) + "]";
return _computedBefore + this.alter.get(node.range[0], node.range[1]) + _computedAfter;
}

@@ -681,6 +706,6 @@

if( node.type === "Literal" ) {
result = "[" + node.raw + "]";
result = _computedBefore + node.raw + _computedAfter;
}
else {
result = "." + node.name;
result = _dot + node.name;
}

@@ -690,2 +715,3 @@

}
core.__printNode(node)

@@ -1451,3 +1477,3 @@ assert(false);

}
};
});

@@ -1454,0 +1480,0 @@ for(let i in core) if( core.hasOwnProperty(i) && typeof core[i] === "function" ) {

@@ -169,3 +169,4 @@ "use strict";

this.alter.insertBefore(fnBodyStart, "{", {extend: true});
this.alter.insert(fnBodyEnd, "}", {extend: true});
// this.alter.insertBefore(fnBodyEnd, "}", {extend: true});
this.alter.insert(fnBodyEnd, "}");

@@ -172,0 +173,0 @@ if( fnBodyHasHiddenBrackets ) {

@@ -23,5 +23,3 @@ "use strict";

const $defineProperty = "Object.defineProperty";
const $defineProperties = "Object.defineProperties";
const $GOPDS_P = "Object.getOwnPropertyDescriptors||function(o){" +
const $GOPDS_P = "function(o){" +
"var d=Object.create(null);" +

@@ -54,2 +52,5 @@ "for(var p in o)if(o.hasOwnProperty(p)){" +

this.options = options;
core.registerVar('getPropertiesDef', {name: 'GOPDS_P', template: $GOPDS_P});
core.registerVar('getAccessorsDef', {name: 'GOPDS_A', template: $GOPDS_A});
}

@@ -98,7 +99,2 @@

let Object_defineProperty_name;
let Object_defineProperties_name;
let $GOPDS_P_name;
let $GOPDS_A_name;
let objectOpened = '';

@@ -146,18 +142,8 @@

if ( !Object_defineProperty_name ) {
Object_defineProperty_name = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
}
beforeString = Object_defineProperty_name + '(' + beforeString;
beforeString = core.createVars(node, "defineProperty") + '(' + beforeString;
}
else {
if ( !Object_defineProperties_name ) {
Object_defineProperties_name = core.bubbledVariableDeclaration(node.$scope, "DPS", $defineProperties);
}
beforeString = core.createVars(node, "defineProperties") + '(' + beforeString;
beforeString = Object_defineProperties_name + '(' + beforeString;
if ( !$GOPDS_A_name ) {
$GOPDS_A_name = core.bubbledVariableDeclaration(node.$scope, "GOPDS_A", $GOPDS_A);
}
this.alter.insertBefore(property.range[0], $GOPDS_A_name + '({');
this.alter.insertBefore(property.range[0], core.createVars(node, "getAccessorsDef") + '({');
}

@@ -191,8 +177,4 @@

if ( !Object_defineProperty_name ) {
Object_defineProperty_name = core.bubbledVariableDeclaration(node.$scope, "DP", $defineProperty);
}
beforeString = core.createVars(node, "defineProperty") + '(' + beforeString;
beforeString = Object_defineProperty_name + '(' + beforeString;
let propKey = property.key;

@@ -216,14 +198,7 @@ if ( isComputed ) {

else if ( computedReplacementStarted ) {
if ( !Object_defineProperties_name ) {
Object_defineProperties_name = core.bubbledVariableDeclaration(node.$scope, "DPS", $defineProperties);
}
beforeString = core.createVars(node, "defineProperties") + '(' + beforeString;
beforeString = Object_defineProperties_name + '(' + beforeString;
closeOpenTag(prevProperty);
if ( !$GOPDS_P_name ) {
$GOPDS_P_name = core.bubbledVariableDeclaration(node.$scope, "GOPDS_P", $GOPDS_P);
}
this.alter.insertBefore(property.range[0], $GOPDS_P_name + '({', {extend: true});
this.alter.insertBefore(property.range[0], core.createVars(node, "getPropertiesDef") + '({', {extend: true});

@@ -230,0 +205,0 @@ endFragment = '}))';

@@ -158,3 +158,3 @@ /*globals module,require*/

this.alter.insert(start, "(" + temporaryVarName);
this.alter.insertBefore(end, ")");
this.alter.insertBefore(end, ")", {extend: true});
}

@@ -161,0 +161,0 @@

@@ -65,3 +65,3 @@ "use strict";

function getRange(node) {
return node && (node.groupRange || node.range);
return node && (node.bracesRange || node.groupRange || node.range);
}

@@ -124,2 +124,6 @@

const argsLength = args.length;
const isSuper = isMemberExpression
? node.callee.object.$originalName === 'super' || node.callee.object.name === 'super'
: node.callee.$originalName === 'super' || node.callee.name === 'super'
;

@@ -133,8 +137,15 @@ assert(argsLength);

if( isMemberExpression ) {
if( isSimpleMemberExpression ) {
expressionInside =
".apply("
+ this.alter.get(node.callee.object.range[0], node.callee.object.range[1])
+ ", "
;
if( isSimpleMemberExpression || isSuper ) {
if ( isSuper ) {
expressionInside =
".apply(this, "
;
}
else {
expressionInside =
".apply("
+ this.alter.get(node.callee.object.range[0], node.callee.object.range[1])
+ ", "
;
}
}

@@ -157,5 +168,12 @@ else {

else {
expressionInside =
".apply(null, "
;
if ( isSuper ) {
expressionInside =
".apply(this, "
;
}
else {
expressionInside =
".apply(null, "
;
}

@@ -162,0 +180,0 @@ if( node.callee.type === "FunctionExpression" ) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc