-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(translator): check for shadowing
data
with a tag destructure
- Loading branch information
1 parent
11d1389
commit da01103
Showing
9 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/translator-default/test/fixtures/data-destructure/snapshots/cjs-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"use strict"; | ||
|
||
exports.__esModule = true; | ||
exports.default = void 0; | ||
var _index = require("marko/src/runtime/html/index.js"); | ||
var _attrTag = require("marko/src/runtime/helpers/attr-tag.js"); | ||
var _renderer = _interopRequireDefault(require("marko/src/core-tags/core/await/renderer.js")); | ||
var _renderTag = _interopRequireDefault(require("marko/src/runtime/helpers/render-tag.js")); | ||
var _renderer2 = _interopRequireDefault(require("marko/src/runtime/components/renderer.js")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const _marko_componentType = "packages/translator-default/test/fixtures/data-destructure/template.marko", | ||
_marko_template = (0, _index.t)(_marko_componentType); | ||
var _default = exports.default = _marko_template; | ||
const _marko_component = {}; | ||
_marko_template._ = (0, _renderer2.default)(function (input, out, _componentDef, _component, state, $global) { | ||
(0, _renderTag.default)(_renderer.default, (0, _attrTag.i)(() => { | ||
(0, _attrTag.a)("then", { | ||
"renderBody": (out, { | ||
data | ||
}) => { | ||
console.log(data); | ||
} | ||
}); | ||
}, { | ||
"_provider": Promise.resolve({ | ||
data: true | ||
}), | ||
"_name": "Promise.resolve({\n data: true\n})" | ||
}), out, _componentDef, "0"); | ||
console.log(input); | ||
}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); |
1 change: 1 addition & 0 deletions
1
...lator-default/test/fixtures/data-destructure/snapshots/generated-expected.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deprecation[fixable](7:15-7:19): The 'data' variable is deprecated. Use 'input' instead. |
10 changes: 10 additions & 0 deletions
10
...ages/translator-default/test/fixtures/data-destructure/snapshots/generated-expected.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<await(Promise.resolve({ | ||
data: true | ||
}))> | ||
<@then|{ | ||
data | ||
}|> | ||
$ console.log(data); | ||
</@then> | ||
</await> | ||
$ console.log(input); |
30 changes: 30 additions & 0 deletions
30
packages/translator-default/test/fixtures/data-destructure/snapshots/html-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { t as _t } from "marko/src/runtime/html/index.js"; | ||
const _marko_componentType = "packages/translator-default/test/fixtures/data-destructure/template.marko", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
import { a as _marko_repeatable_attr_tag, i as _marko_render_input } from "marko/src/runtime/helpers/attr-tag.js"; | ||
import _await from "marko/src/core-tags/core/await/renderer.js"; | ||
import _marko_tag from "marko/src/runtime/helpers/render-tag.js"; | ||
import _marko_renderer from "marko/src/runtime/components/renderer.js"; | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) { | ||
_marko_tag(_await, _marko_render_input(() => { | ||
_marko_repeatable_attr_tag("then", { | ||
"renderBody": (out, { | ||
data | ||
}) => { | ||
console.log(data); | ||
} | ||
}); | ||
}, { | ||
"_provider": Promise.resolve({ | ||
data: true | ||
}), | ||
"_name": "Promise.resolve({\n data: true\n})" | ||
}), out, _componentDef, "0"); | ||
console.log(input); | ||
}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); |
29 changes: 29 additions & 0 deletions
29
...es/translator-default/test/fixtures/data-destructure/snapshots/htmlProduction-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { t as _t } from "marko/dist/runtime/html/index.js"; | ||
const _marko_componentType = "yrkdiQvb", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
import { a as _marko_repeatable_attr_tag, i as _marko_render_input } from "marko/dist/runtime/helpers/attr-tag.js"; | ||
import _await from "marko/dist/core-tags/core/await/renderer.js"; | ||
import _marko_tag from "marko/dist/runtime/helpers/render-tag.js"; | ||
import _marko_renderer from "marko/dist/runtime/components/renderer.js"; | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) { | ||
_marko_tag(_await, _marko_render_input(() => { | ||
_marko_repeatable_attr_tag("then", { | ||
"renderBody": (out, { | ||
data | ||
}) => { | ||
console.log(data); | ||
} | ||
}); | ||
}, { | ||
"_provider": Promise.resolve({ | ||
data: true | ||
}), | ||
"_name": "Promise.resolve({\n data: true\n})" | ||
}), out, _componentDef, "0"); | ||
console.log(input); | ||
}, { | ||
t: _marko_componentType, | ||
i: true | ||
}, _marko_component); |
Empty file.
34 changes: 34 additions & 0 deletions
34
packages/translator-default/test/fixtures/data-destructure/snapshots/vdom-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { t as _t } from "marko/src/runtime/vdom/index.js"; | ||
const _marko_componentType = "packages/translator-default/test/fixtures/data-destructure/template.marko", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
import { a as _marko_repeatable_attr_tag, i as _marko_render_input } from "marko/src/runtime/helpers/attr-tag.js"; | ||
import _await from "marko/src/core-tags/core/await/renderer.js"; | ||
import _marko_tag from "marko/src/runtime/helpers/render-tag.js"; | ||
import _marko_renderer from "marko/src/runtime/components/renderer.js"; | ||
import { r as _marko_registerComponent } from "marko/src/runtime/components/registry.js"; | ||
_marko_registerComponent(_marko_componentType, () => _marko_template); | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) { | ||
_marko_tag(_await, _marko_render_input(() => { | ||
_marko_repeatable_attr_tag("then", { | ||
"renderBody": (out, { | ||
data | ||
}) => { | ||
console.log(data); | ||
} | ||
}); | ||
}, { | ||
"_provider": Promise.resolve({ | ||
data: true | ||
}), | ||
"_name": "Promise.resolve({\n data: true\n})" | ||
}), out, _componentDef, "0"); | ||
console.log(input); | ||
}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); | ||
import _marko_defineComponent from "marko/src/runtime/components/defineComponent.js"; | ||
_marko_template.Component = _marko_defineComponent(_marko_component, _marko_template._); |
33 changes: 33 additions & 0 deletions
33
...es/translator-default/test/fixtures/data-destructure/snapshots/vdomProduction-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { t as _t } from "marko/dist/runtime/vdom/index.js"; | ||
const _marko_componentType = "yrkdiQvb", | ||
_marko_template = _t(_marko_componentType); | ||
export default _marko_template; | ||
import { a as _marko_repeatable_attr_tag, i as _marko_render_input } from "marko/dist/runtime/helpers/attr-tag.js"; | ||
import _await from "marko/dist/core-tags/core/await/renderer.js"; | ||
import _marko_tag from "marko/dist/runtime/helpers/render-tag.js"; | ||
import _marko_renderer from "marko/dist/runtime/components/renderer.js"; | ||
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry.js"; | ||
_marko_registerComponent(_marko_componentType, () => _marko_template); | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) { | ||
_marko_tag(_await, _marko_render_input(() => { | ||
_marko_repeatable_attr_tag("then", { | ||
"renderBody": (out, { | ||
data | ||
}) => { | ||
console.log(data); | ||
} | ||
}); | ||
}, { | ||
"_provider": Promise.resolve({ | ||
data: true | ||
}), | ||
"_name": "Promise.resolve({\n data: true\n})" | ||
}), out, _componentDef, "0"); | ||
console.log(input); | ||
}, { | ||
t: _marko_componentType, | ||
i: true | ||
}, _marko_component); | ||
import _marko_defineComponent from "marko/dist/runtime/components/defineComponent.js"; | ||
_marko_template.Component = _marko_defineComponent(_marko_component, _marko_template._); |
7 changes: 7 additions & 0 deletions
7
packages/translator-default/test/fixtures/data-destructure/template.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<await(Promise.resolve({data: true}))> | ||
<@then|{data}|> | ||
$ console.log(data) | ||
</@then> | ||
</await> | ||
|
||
$ console.log(data); |