Added more typechecking functions and unit tests for existing code.
commitb814ba0d3921aaf296ebe1b653ab2827f671a7dd
authorjrw <jrw@chromium.org>
Thu, 19 Mar 2015 20:08:45 +0000 (19 13:08 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 19 Mar 2015 20:09:52 +0000 (19 20:09 +0000)
treedc9c27a220e23b9aa18603de67c33eeb50212b2e
parent43dc9613e9badb5e0c6a11d25106271d2f23899f
Added more typechecking functions and unit tests for existing code.

This change alters the functionality of getObjectAttr slightly: it no
longer accepts null or Array objects as "object" values.  I made this
change because the type checking code seems designed to mirror the
semantics of JSON, where each value belongs to exactly one of the
following categories: array, boolean, number, null, object, or string.

This change also changes the type of values thrown from strings to Error objects so that there are more likely to be useful stack traces when an error occurs.

BUG=

Review URL: https://codereview.chromium.org/1015553003

Cr-Commit-Position: refs/heads/master@{#321415}
15 files changed:
remoting/remoting_webapp_files.gypi
remoting/webapp/app_remoting/js/app_remoting.js
remoting/webapp/base/js/base.js
remoting/webapp/crd/js/cast_extension_handler.js
remoting/webapp/crd/js/client_plugin_host_desktop_impl.js
remoting/webapp/crd/js/client_plugin_impl.js
remoting/webapp/crd/js/gnubby_auth_handler.js
remoting/webapp/crd/js/host.js
remoting/webapp/crd/js/host_daemon_facade.js
remoting/webapp/crd/js/host_list_api_impl.js
remoting/webapp/crd/js/it2me_host_facade.js
remoting/webapp/crd/js/typecheck.js
remoting/webapp/crd/js/typecheck_unittest.js [new file with mode: 0644]
remoting/webapp/crd/js/video_frame_recorder.js
remoting/webapp/js_proto/qunit_proto.js