# toLowerCase function stoped working after update to 0.35.0

**URL:** <https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742>\
**Category:** Bug Reports\
**Created:** [April 3, 2017, 8:20pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742 "2017-04-03T20:20:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kevin](https://forums.fusetools.com/u/kevin)\
**Post date:** [April 3, 2017, 8:20pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742/1 "2017-04-03T20:20:55Z")

</div>

code worked fine on .29 (version i run before updating) but on .35 it crashes the app don’t know why looks like its looping the function…?

```
		makeLowerCase = function(obs, op, arg, origin){
		  if (origin === makeLowerCase) return;
		  username.setValueWithOrigin(username.value.toLowerCase(), makeLowerCase);
		};
		username.addSubscriber(makeLowerCase);
```

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [April 3, 2017, 9:56pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742/2 "2017-04-03T21:56:58Z")

</div>

Hi! That’s unfortunate.

Can you please upload an example project that reproduces this (that works in 0.29 but not in 0.35) ?

`toLowerCase` is a built-in function in the JavaScript language/standard lib, so its very unlikely that the actual issue is that the API disappeared. Probably something else specific to your project.

---

<div class="post-metadata">

**Author:** ![kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kevin](https://forums.fusetools.com/u/kevin)\
**Post date:** [April 3, 2017, 11:21pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742/3 "2017-04-03T23:21:16Z")

</div>

Hi Anders

getting the same results with this bit of code:

```
	<App>
		<ClientPanel>

			<JavaScript>
				var Observable = require("FuseJS/Observable");
				var username = Observable("");

				makeLowerCase = function(obs, op, arg, origin){
				  if (origin === makeLowerCase) return;
				  username.setValueWithOrigin(username.value.toLowerCase(), makeLowerCase);
				};
				username.addSubscriber(makeLowerCase);

				module.exports = {
					'username': username
				}
			</JavaScript>

			<StackPanel ux:Name="loginForm" Alignment="Center" Margin="50,0,50,0" Width="300">
				<TextInput ux:Name="emailText" PlaceholderText="username" Value="{username}">
				    <Rectangle Dock="Bottom" Height="2" Margin="0" Fill="#f5b5a5" Opacity="0.7" />
				</TextInput>
			</StackPanel>

		</ClientPanel>
	</App>

```

[![](http://i.imgur.com/CM7XH1R.png) ](http://i.imgur.com/CM7XH1R.png)

---

<div class="post-metadata">

**Author:** ![kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kevin](https://forums.fusetools.com/u/kevin)\
**Post date:** [April 4, 2017, 1:34pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742/4 "2017-04-04T13:34:18Z")

</div>

It Just goes mad and prints ‘Log: expected number was Fuse.Scripting.V8.Function’ 1000x a second…

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [April 4, 2017, 5:30pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742/5 "2017-04-04T17:30:12Z")

</div>

Kevin: The `setValueWithOrigin` method is not documented and doesn’t work the way your code implies.

Generally, you writing back to an observable in response to the user changing the value is not a good pattern, as this is asynchronous and leads to erratic beahvior.

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [April 4, 2017, 5:33pm UTC](https://forums.fusetools.com/t/tolowercase-function-stoped-working-after-update-to-0-35-0/6742/6 "2017-04-04T17:33:07Z")

</div>

You can do this, however it relies on another non-public API and is subject to change in the future:

```auto
var selfOrigin = Observable._createOrigin()
makeLowerCase = function(obs, op, arg, origin){
    if (origin === selfOrigin) return;
    username.setValueWithOrigin(username.value.toLowerCase(), selfOrigin);
};
username.addSubscriber(makeLowerCase);

```

Use at your own risk
