Comparing version 0.5.7 to 0.5.8
{ | ||
"name": "jsdc", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "compiler ecmascript6 to ecmascript5", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -119,5 +119,6 @@ var homunculus = require('homunculus'); | ||
} | ||
//get/set | ||
else { | ||
var token = first.token(); | ||
if(start) { | ||
var token = first.token(); | ||
var prptn = first.next(); | ||
@@ -148,6 +149,36 @@ this.gs[prptn.nid()] = true; | ||
&& first.token().content() == 'static') { | ||
if(start) { | ||
this.jsdc.ignore(first.token(), 'klass15'); | ||
this.jsdc.append(o.name + '.'); | ||
var token = first.token(); | ||
first = first.next().first(); | ||
if(first.name() == JsNode.PROPTNAME) { | ||
if(start) { | ||
this.jsdc.ignore(token, 'klass15'); | ||
this.jsdc.append(o.name + '.'); | ||
} | ||
} | ||
else { | ||
if(start) { | ||
this.jsdc.ignore(token, 'klass17'); | ||
token = first.token(); | ||
var prptn = first.next(); | ||
this.gs[prptn.nid()] = true; | ||
this.jsdc.ignore(prptn, 'klass18'); | ||
this.jsdc.append('Object.defineProperty('); | ||
this.jsdc.append(o.name); | ||
this.jsdc.append(', "'); | ||
if(token.content() == 'get') { | ||
var n = first.next().first().first().token(); | ||
o.g = n.content(); | ||
this.jsdc.append(o.g); | ||
} | ||
else { | ||
var n = first.next().first().first().token(); | ||
o.s = n.content(); | ||
this.jsdc.append(o.s); | ||
} | ||
this.jsdc.append('", {'); | ||
} | ||
else { | ||
this.jsdc.appendBefore('});'); | ||
} | ||
} | ||
} | ||
@@ -205,2 +236,6 @@ }, | ||
&& parent.prev().token().content() == 'static') { | ||
if(parent.first().name() == JsNode.TOKEN | ||
&& ['get', 'set'].indexOf(parent.first().token().content()) > -1) { | ||
return; | ||
} | ||
parent = parent.parent(); | ||
@@ -207,0 +242,0 @@ if(parent.name() == JsNode.CLASSELEM) { |
@@ -119,5 +119,6 @@ define(function(require, exports, module){var homunculus = require('homunculus'); | ||
} | ||
//get/set | ||
else { | ||
var token = first.token(); | ||
if(start) { | ||
var token = first.token(); | ||
var prptn = first.next(); | ||
@@ -148,6 +149,36 @@ this.gs[prptn.nid()] = true; | ||
&& first.token().content() == 'static') { | ||
if(start) { | ||
this.jsdc.ignore(first.token(), 'klass15'); | ||
this.jsdc.append(o.name + '.'); | ||
var token = first.token(); | ||
first = first.next().first(); | ||
if(first.name() == JsNode.PROPTNAME) { | ||
if(start) { | ||
this.jsdc.ignore(token, 'klass15'); | ||
this.jsdc.append(o.name + '.'); | ||
} | ||
} | ||
else { | ||
if(start) { | ||
this.jsdc.ignore(token, 'klass17'); | ||
token = first.token(); | ||
var prptn = first.next(); | ||
this.gs[prptn.nid()] = true; | ||
this.jsdc.ignore(prptn, 'klass18'); | ||
this.jsdc.append('Object.defineProperty('); | ||
this.jsdc.append(o.name); | ||
this.jsdc.append(', "'); | ||
if(token.content() == 'get') { | ||
var n = first.next().first().first().token(); | ||
o.g = n.content(); | ||
this.jsdc.append(o.g); | ||
} | ||
else { | ||
var n = first.next().first().first().token(); | ||
o.s = n.content(); | ||
this.jsdc.append(o.s); | ||
} | ||
this.jsdc.append('", {'); | ||
} | ||
else { | ||
this.jsdc.appendBefore('});'); | ||
} | ||
} | ||
} | ||
@@ -205,2 +236,6 @@ }, | ||
&& parent.prev().token().content() == 'static') { | ||
if(parent.first().name() == JsNode.TOKEN | ||
&& ['get', 'set'].indexOf(parent.first().token().content()) > -1) { | ||
return; | ||
} | ||
parent = parent.parent(); | ||
@@ -207,0 +242,0 @@ if(parent.name() == JsNode.CLASSELEM) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
321753
8045