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 692eee3
Show file tree
Hide file tree
Showing 33 changed files with 265 additions and 2 deletions.
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 692eee3

Please sign in to comment.