{"size": 667, "ext": "js", "max_stars_repo_path": "externals/dojo/dojo/tests/Stateful.js", "max_stars_repo_name": "ddgc/zf1", "max_stars_repo_stars_event_min_datetime": "2020-04-17T14:10:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-17T21:47:28.000Z", "max_issues_repo_path": "externals/dojo/dojo/tests/Stateful.js", "max_issues_repo_name": "mridgway/Zend-Framework-1.x-Mirror", "max_issues_repo_issues_event_min_datetime": "2021-01-30T03:54:17.000Z", "max_issues_repo_issues_event_max_datetime": "2021-01-30T23:24:54.000Z", "max_forks_repo_path": "externals/dojo/dojo/tests/Stateful.js", "max_forks_repo_name": "mridgway/Zend-Framework-1.x-Mirror", "max_forks_repo_forks_event_min_datetime": "2020-03-10T01:36:57.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-19T07:17:46.000Z"}
{"max_stars_count": 2, "max_issues_count": 2, "max_forks_count": 15, "avg_line_length": 18.027027027, "max_line_length": 65, "alphanum_fraction": 0.5277361319}
dojo.provide("tests.Stateful");

dojo.require("dojo.Stateful");

doh.register("tests.Stateful", 
	[
		function getSetWatch(t){
			var s = new dojo.Stateful({
				foo: 3
			});
			doh.is(s.get("foo"), 3);
			var watching = s.watch("foo", function(name, oldValue, value){
				doh.is(name, "foo");
				doh.is(oldValue, 3);
				doh.is(value, 4);
				doh.is(s.get("foo"), 4);
			});
			s.set("foo", 4);
			doh.is(s.get("foo"), 4);
			watching.unwatch();
			s.set("foo", 5);
			doh.is(s.get("foo"), 5);
		},
		function setHash(t){
			var s = new dojo.Stateful();
			s.set({
				foo:3,
				bar: 5
			});
			doh.is(s.get("foo"), 3);
			doh.is(s.get("bar"), 5);
		}		


	]
);
