let this point to instance

pull/4523/head
hontas 6 years ago
parent 7d9ff14099
commit bab037e60e

@ -127,7 +127,7 @@ export function init(component, options, instance, create_fragment, not_equal, p
let ready = false;
$$.ctx = instance
? instance(component, prop_values, (i, ret, ...rest) => {
? instance.call(component, component, prop_values, (i, ret, ...rest) => {
const value = rest.length ? rest[0] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if ($$.bound[i]) $$.bound[i](value);

@ -0,0 +1,7 @@
<svelte:options tag="my-app"/>
<script>
export let self;
self = this;
</script>

@ -0,0 +1,8 @@
import * as assert from 'assert';
import './main.svelte';
export default function (target) {
target.innerHTML = '<my-app />';
const el = target.querySelector('my-app');
assert.ok(el.self === el);
}
Loading…
Cancel
Save