Skip to content

Commit

Permalink
throw "Destructuring to a super field is not supported yet."
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed May 27, 2019
1 parent d344e8d commit 4648b65
Show file tree
Hide file tree
Showing 34 changed files with 266 additions and 2 deletions.
Expand Up @@ -147,6 +147,7 @@ export function createClassFeaturePlugin({

if (isDecorated) {
staticNodes = keysNodes = [];
console.log("buildDecoratedClass");
({ instanceNodes, wrapClass } = buildDecoratedClass(
ref,
path,
Expand Down
6 changes: 4 additions & 2 deletions packages/babel-helper-replace-supers/src/index.js
Expand Up @@ -125,8 +125,10 @@ const specHandlers = {
]);
},

destructureSet() {
// TODO
destructureSet(superMember) {
throw superMember.buildCodeFrameError(
`Destructuring to a super field is not supported yet.`,
);
},

call(superMember, args) {
Expand Down
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;([x, ...super.client] = props);
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;([super.client] = props);
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;({ x, ...super.client } = props)
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;({ client: super.client } = props)
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
foo(props) {
;([x, ...super.client] = props);
}
}
@@ -0,0 +1,16 @@
var Foo =
/*#__PURE__*/
function () {
"use strict";

function Foo() {}

var _proto = Foo.prototype;

_proto.foo = function foo(props) {
;
[x, ...this.client] = props;
};

return Foo;
}();
@@ -0,0 +1,5 @@
class Foo {
foo(props) {
;([super.client] = props);
}
}
@@ -0,0 +1,16 @@
var Foo =
/*#__PURE__*/
function () {
"use strict";

function Foo() {}

var _proto = Foo.prototype;

_proto.foo = function foo(props) {
;
[this.client] = props;
};

return Foo;
}();
@@ -0,0 +1,5 @@
class Foo {
foo(props) {
;({ x, ...super.client } = props)
}
}
@@ -0,0 +1,19 @@
var Foo =
/*#__PURE__*/
function () {
"use strict";

function Foo() {}

var _proto = Foo.prototype;

_proto.foo = function foo(props) {
;
({
x,
...this.client
} = props);
};

return Foo;
}();
@@ -0,0 +1,5 @@
class Foo {
foo(props) {
;({ client: super.client } = props)
}
}
@@ -0,0 +1,18 @@
var Foo =
/*#__PURE__*/
function () {
"use strict";

function Foo() {}

var _proto = Foo.prototype;

_proto.foo = function foo(props) {
;
({
client: this.client
} = props);
};

return Foo;
}();
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;([x, ...super.client] = props);
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"transform-function-name",
"transform-classes",
"transform-spread",
"transform-block-scoping"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;([super.client] = props);
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"transform-function-name",
"transform-classes",
"transform-spread",
"transform-block-scoping"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;({ x, ...super.client } = props)
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"transform-function-name",
"transform-classes",
"transform-spread",
"transform-block-scoping"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
class Foo {
constructor(props) {
;({ client: super.client } = props)
}
}
@@ -0,0 +1,10 @@
{
"plugins": [
"external-helpers",
"transform-function-name",
"transform-classes",
"transform-spread",
"transform-block-scoping"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
const foo = {
bar(props) {
;([x, ...super.client] = props);
}
}
@@ -0,0 +1,8 @@
{
"plugins": [
"external-helpers",
"transform-object-super",
"transform-shorthand-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
const foo = {
bar(props) {
;([super.client] = props);
}
}
@@ -0,0 +1,8 @@
{
"plugins": [
"external-helpers",
"transform-object-super",
"transform-shorthand-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
const foo = {
bar(props) {
;({ x, ...super.client } = props)
}
}
@@ -0,0 +1,8 @@
{
"plugins": [
"external-helpers",
"transform-object-super",
"transform-shorthand-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}
@@ -0,0 +1,5 @@
const foo = {
bar(props) {
;({ client: super.client } = props)
}
}
@@ -0,0 +1,8 @@
{
"plugins": [
"external-helpers",
"transform-object-super",
"transform-shorthand-properties"
],
"throws": "Destructuring to a super field is not supported yet."
}

0 comments on commit 4648b65

Please sign in to comment.