Repository: sveltejs/svelte (JavaScript)
Task: Bug Fix (2019-01-04 19:04:13+00:00)

Issue:
Props starting with "use" are interpreted as action
When using a prop called user (`<Nested user={currentUser}/>`)
it throws `Actions can only be applied to DOM elements, not components`.
Props starting with "use" are interpreted as action
When using a prop called user (`<Nested user={currentUser}/>`)
it throws `Actions can only be applied to DOM elements, not components`.


Discussion:

Patch:
diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts
--- a/src/parse/state/tag.ts
+++ b/src/parse/state/tag.ts
@@ -379,7 +379,7 @@ function readAttribute(parser: Parser, uniqueNames: Set<string>) {
 	parser.allowWhitespace();
 
 	const colon_index = name.indexOf(':');
-	const type = colon_index !== 1 && get_directive_type(name.slice(0, colon_index));
+	const type = colon_index !== -1 && get_directive_type(name.slice(0, colon_index));
 
 	let value: any[] | true = true;
 	if (parser.eat('=')) {


Test patch:
diff --git a/test/runtime/samples/prop-not-action/Nested.html b/test/runtime/samples/prop-not-action/Nested.html
new file mode 100644
--- /dev/null
+++ b/test/runtime/samples/prop-not-action/Nested.html
@@ -0,0 +1 @@
+<h1>Hello {user.name}!</h1>
\ No newline at end of file
diff --git a/test/runtime/samples/prop-not-action/_config.js b/test/runtime/samples/prop-not-action/_config.js
new file mode 100644
--- /dev/null
+++ b/test/runtime/samples/prop-not-action/_config.js
@@ -0,0 +1,9 @@
+export default {
+	props: {
+		currentUser: { name: 'world' }
+	},
+
+	html: `
+		<h1>Hello world!</h1>
+	`
+};
\ No newline at end of file
diff --git a/test/runtime/samples/prop-not-action/main.html b/test/runtime/samples/prop-not-action/main.html
new file mode 100644
--- /dev/null
+++ b/test/runtime/samples/prop-not-action/main.html
@@ -0,0 +1,6 @@
+<script>
+	import Nested from './Nested.html';
+	export let currentUser;
+</script>
+
+<Nested user={currentUser}/>
\ No newline at end of file