closure 1.1.692 → 1.2.701

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/README.md +0 -13
  2. data/closure-library/alltests.js +1 -1
  3. data/closure-library/closure/goog/debug/reflect.js +5 -1
  4. data/closure-library/closure/goog/deps.js +7 -0
  5. data/closure-library/closure/goog/i18n/messageformat.js +4 -1
  6. data/closure-library/closure/goog/i18n/messageformat_test.html +11 -0
  7. data/closure-library/closure/goog/math/vec3.js +0 -19
  8. data/closure-library/closure/goog/messaging/portcaller.js +150 -0
  9. data/closure-library/closure/goog/messaging/portcaller_test.html +66 -0
  10. data/closure-library/closure/goog/messaging/portnetwork.js +78 -0
  11. data/closure-library/closure/goog/messaging/portnetwork_test.html +64 -0
  12. data/closure-library/closure/goog/messaging/portoperator.js +196 -0
  13. data/closure-library/closure/goog/messaging/portoperator_test.html +112 -0
  14. data/closure-library/closure/goog/messaging/testdata/portchannel_inner.html +28 -0
  15. data/closure-library/closure/goog/messaging/testdata/portnetwork_inner.html +35 -0
  16. data/closure-library/closure/goog/messaging/testdata/portnetwork_worker1.js +33 -0
  17. data/closure-library/closure/goog/messaging/testdata/portnetwork_worker2.js +33 -0
  18. data/closure-library/closure/goog/testing/functionmock.js +1 -1
  19. data/closure-library/closure/goog/testing/messaging/mockmessageport.js +85 -0
  20. data/closure-library/closure/goog/testing/messaging/mockportnetwork.js +64 -0
  21. data/closure-library/closure/goog/tweak/tweak.js +1 -1
  22. data/closure-library/closure/goog/ui/advancedtooltip.js +1 -2
  23. data/closure-library/closure/goog/ui/filteredmenu.js +2 -2
  24. data/closure-library/closure/goog/ui/menubutton.js +6 -0
  25. data/closure-library/third_party/closure/goog/dojo/dom/query.js +9 -4
  26. data/closure.gemspec +1 -2
  27. data/config.ru +4 -4
  28. data/lib/closure.rb +3 -1
  29. data/lib/closure/compiler.rb +11 -24
  30. data/lib/closure/goog.rb +37 -16
  31. data/lib/closure/middleware.rb +2 -2
  32. data/lib/closure/script.rb +12 -4
  33. data/lib/closure/server.rb +3 -1
  34. data/lib/closure/show_exceptions.rb +63 -0
  35. data/lib/closure/sources.rb +22 -6
  36. data/lib/closure/templates.rb +2 -2
  37. data/lib/closure/version.rb +1 -1
  38. data/scripts/demos/compiler.build +1 -0
  39. data/scripts/demos/compiler.debug +24 -0
  40. data/scripts/demos/compiler.js.erb +22 -0
  41. data/scripts/demos/compiler.map +114 -0
  42. data/scripts/demos/googly.erb +19 -0
  43. data/scripts/demos/googly.js +24 -0
  44. data/scripts/demos/helloworld.erb +24 -0
  45. data/scripts/demos/index.erb +29 -0
  46. data/scripts/demos/{externs_jquery.js → jquery.js} +0 -0
  47. data/scripts/demos/rails_ujs.erb +38 -0
  48. data/scripts/{examples/rails/ujs.js → demos/rails_ujs.js} +0 -0
  49. data/scripts/externs/jquery-ui.externs +10 -0
  50. data/scripts/externs/jquery.externs +4 -0
  51. data/scripts/{demos/externs_jquery.externs → externs/jquery_1_4_2.externs} +1 -1
  52. data/scripts/index.erb +19 -0
  53. metadata +36 -24
  54. data/scripts/demos/compile.js.erb +0 -8
  55. data/scripts/demos/compile.out +0 -1
  56. data/scripts/demos/compiler.haml +0 -17
  57. data/scripts/demos/compiler.js +0 -12
  58. data/scripts/demos/externs.haml +0 -16
  59. data/scripts/demos/externs.js.erb +0 -8
  60. data/scripts/demos/externs.out +0 -1
  61. data/scripts/demos/externs_jquerytest.js +0 -11
  62. data/scripts/demos/helloworld.haml +0 -15
  63. data/scripts/demos/index.haml +0 -21
  64. data/scripts/demos/rails_ujs.haml +0 -24
  65. data/scripts/favicon.ico +0 -0
  66. data/scripts/index.haml +0 -14
data/README.md CHANGED
@@ -11,16 +11,3 @@ Getting Started documentation is on the wiki;
11
11
 
12
12
  Advanced documentation is in YARD format;
13
13
  <http://rubydoc.info/gems/closure/frames>
14
-
15
-
16
- Version 1.1
17
-
18
- * New gem name: gem install closure
19
- * The official project name is now Closure Script. The development codename, Googlyscript, is retired.
20
- * Interfaces to Closure::Sources has been cleaned for use in a non-server environment. No more placeholder arguments and sources can be added without an http route.
21
- * Experimental support for provide/require in externs. Scripts with a .externs suffix are scanned for goog.provide and goog.require statements. Due to compiler.jar not supporting this yet, place start and end comment markers on the lines before and after the goog statements.
22
- * Closure Templates error reporting has been integrated. If you were checking Soy errors you no longer need to if you are loading goog.deps_js or using goog.compile(args).to_response_with_console.
23
-
24
- Version 1.0
25
-
26
- * Credits: David Turnbull, Dan Herrera, Max Ogden and Andrew Kurtz.
@@ -13,4 +13,4 @@
13
13
  // limitations under the License.
14
14
 
15
15
  var _allTests = [
16
- "closure/goog/array/array_test.html","closure/goog/asserts/asserts_test.html","closure/goog/async/conditionaldelay_test.html","closure/goog/async/delay_test.html","closure/goog/async/throttle_test.html","closure/goog/base_test.html","closure/goog/color/alpha_test.html","closure/goog/color/color_test.html","closure/goog/crypt/arc4_test.html","closure/goog/crypt/base64_test.html","closure/goog/crypt/basen_test.html","closure/goog/crypt/crypt_test.html","closure/goog/crypt/hash32_test.html","closure/goog/crypt/sha1_test.html","closure/goog/cssom/cssom_test.html","closure/goog/cssom/iframe/style_test.html","closure/goog/datasource/datasource_test.html","closure/goog/datasource/expr_test.html","closure/goog/datasource/fastdatanode_test.html","closure/goog/datasource/jsxmlhttpdatasource_test.html","closure/goog/date/daterange_test.html","closure/goog/date/date_test.html","closure/goog/date/relative_test.html","closure/goog/date/utcdatetime_test.html","closure/goog/debug/debug_test.html","closure/goog/debug/devcss/devcss_test.html","closure/goog/debug/enhanceerror_test.html","closure/goog/debug/entrypointregistry_test.html","closure/goog/debug/errorhandler_async_test.html","closure/goog/debug/errorhandler_test.html","closure/goog/debug/errorreporter_test.html","closure/goog/debug/error_test.html","closure/goog/debug/logbuffer_test.html","closure/goog/debug/logger_test.html","closure/goog/debug/reflect_test.html","closure/goog/debug/tracer_test.html","closure/goog/disposable/disposable_test.html","closure/goog/dom/a11y_test.html","closure/goog/dom/abstractrange_test.html","closure/goog/dom/annotate_test.html","closure/goog/dom/browserrange/browserrange_test.html","closure/goog/dom/classes_test.html","closure/goog/dom/controlrange_test.html","closure/goog/dom/dataset_test.html","closure/goog/dom/dom_quirks_test.html","closure/goog/dom/dom_test.html","closure/goog/dom/fontsizemonitor_test.html","closure/goog/dom/forms_test.html","closure/goog/dom/iframe_test.html","closure/goog/dom/iter_test.html","closure/goog/dom/multirange_test.html","closure/goog/dom/nodeiterator_test.html","closure/goog/dom/nodeoffset_test.html","closure/goog/dom/pattern/matcher_test.html","closure/goog/dom/pattern/pattern_test.html","closure/goog/dom/range_test.html","closure/goog/dom/savedcaretrange_test.html","closure/goog/dom/savedrange_test.html","closure/goog/dom/selection_test.html","closure/goog/dom/tagiterator_test.html","closure/goog/dom/tagname_test.html","closure/goog/dom/textrangeiterator_test.html","closure/goog/dom/textrange_test.html","closure/goog/dom/viewportsizemonitor_test.html","closure/goog/dom/xml_test.html","closure/goog/editor/clicktoeditwrapper_test.html","closure/goog/editor/field_test.html","closure/goog/editor/focus_test.html","closure/goog/editor/icontent_test.html","closure/goog/editor/link_test.html","closure/goog/editor/node_test.html","closure/goog/editor/plugins/abstractbubbleplugin_test.html","closure/goog/editor/plugins/abstractdialogplugin_test.html","closure/goog/editor/plugins/abstracttabhandler_test.html","closure/goog/editor/plugins/basictextformatter_test.html","closure/goog/editor/plugins/blockquote_test.html","closure/goog/editor/plugins/emoticons_test.html","closure/goog/editor/plugins/enterhandler_test.html","closure/goog/editor/plugins/headerformatter_test.html","closure/goog/editor/plugins/linkbubble_test.html","closure/goog/editor/plugins/linkdialogplugin_test.html","closure/goog/editor/plugins/listtabhandler_test.html","closure/goog/editor/plugins/loremipsum_test.html","closure/goog/editor/plugins/removeformatting_test.html","closure/goog/editor/plugins/spacestabhandler_test.html","closure/goog/editor/plugins/tableeditor_test.html","closure/goog/editor/plugins/tagonenterhandler_test.html","closure/goog/editor/plugins/undoredomanager_test.html","closure/goog/editor/plugins/undoredostate_test.html","closure/goog/editor/plugins/undoredo_test.html","closure/goog/editor/plugin_test.html","closure/goog/editor/range_test.html","closure/goog/editor/seamlessfield_quirks_test.html","closure/goog/editor/seamlessfield_test.html","closure/goog/editor/style_test.html","closure/goog/editor/table_test.html","closure/goog/events/actioneventwrapper_test.html","closure/goog/events/actionhandler_test.html","closure/goog/events/browserevent_test.html","closure/goog/events/eventhandler_test.html","closure/goog/events/events_test.html","closure/goog/events/eventtarget_test.html","closure/goog/events/event_test.html","closure/goog/events/filedrophandler_test.html","closure/goog/events/imehandler_test.html","closure/goog/events/keycodes_test.html","closure/goog/events/keyhandler_test.html","closure/goog/events/mousewheelhandler_test.html","closure/goog/events/onlinelistener_test.html","closure/goog/events/pastehandler_test.html","closure/goog/format/emailaddress_test.html","closure/goog/format/format_test.html","closure/goog/format/htmlprettyprinter_test.html","closure/goog/format/jsonprettyprinter_test.html","closure/goog/fs/fs_test.html","closure/goog/functions/functions_test.html","closure/goog/fx/abstractdragdrop_test.html","closure/goog/fx/cssspriteanimation_test.html","closure/goog/fx/dragdropgroup_test.html","closure/goog/fx/dragger_test.html","closure/goog/fx/draglistgroup_test.html","closure/goog/fx/dragscrollsupport_test.html","closure/goog/fx/fx_test.html","closure/goog/gears/basestore_test.html","closure/goog/gears/database_test.html","closure/goog/gears/fakeworkerpool_test.html","closure/goog/gears/gears_test.html","closure/goog/gears/loggerclient_test.html","closure/goog/gears/loggerserver_test.html","closure/goog/gears/logstore_test.html","closure/goog/gears/managedresourcestore_test.html","closure/goog/gears/multipartformdata_test.html","closure/goog/gears/urlcapture_test.html","closure/goog/gears/workerchannel_test.html","closure/goog/gears/workerpool_test.html","closure/goog/graphics/affinetransform_test.html","closure/goog/graphics/ext/coordinates_test.html","closure/goog/graphics/ext/element_test.html","closure/goog/graphics/ext/path_test.html","closure/goog/graphics/paths_test.html","closure/goog/graphics/path_test.html","closure/goog/history/html5history_test.html","closure/goog/i18n/bidiformatter_test.html","closure/goog/i18n/bidi_test.html","closure/goog/i18n/charlistdecompressor_test.html","closure/goog/i18n/currency_test.html","closure/goog/i18n/datetimeformat_test.html","closure/goog/i18n/datetimeparse_test.html","closure/goog/i18n/graphemebreak_test.html","closure/goog/i18n/messageformat_test.html","closure/goog/i18n/mime_test.html","closure/goog/i18n/numberformat_test.html","closure/goog/i18n/timezone_test.html","closure/goog/i18n/uchar_test.html","closure/goog/iter/iter_test.html","closure/goog/json/json_test.html","closure/goog/locale/countrylanguagenames_test.html","closure/goog/locale/genericfontnames_test.html","closure/goog/locale/timezonedetection_test.html","closure/goog/locale/timezonelist_test.html","closure/goog/math/bezier_test.html","closure/goog/math/box_test.html","closure/goog/math/coordinate3_test.html","closure/goog/math/coordinate_test.html","closure/goog/math/integer_test.html","closure/goog/math/line_test.html","closure/goog/math/long_test.html","closure/goog/math/math_test.html","closure/goog/math/matrix_test.html","closure/goog/math/rangeset_test.html","closure/goog/math/range_test.html","closure/goog/math/rect_test.html","closure/goog/math/size_test.html","closure/goog/math/vec2_test.html","closure/goog/math/vec3_test.html","closure/goog/memoize/memoize_test.html","closure/goog/messaging/abstractchannel_test.html","closure/goog/messaging/bufferedchannel_test.html","closure/goog/messaging/deferredchannel_test.html","closure/goog/messaging/loggerclient_test.html","closure/goog/messaging/loggerserver_test.html","closure/goog/messaging/messaging_test.html","closure/goog/messaging/multichannel_test.html","closure/goog/messaging/portchannel_test.html","closure/goog/module/moduleinfo_test.html","closure/goog/module/moduleloadcallback_test.html","closure/goog/module/moduleloader_test.html","closure/goog/module/modulemanager_test.html","closure/goog/net/browserchannel_test.html","closure/goog/net/bulkloader_test.html","closure/goog/net/channelrequest_test.html","closure/goog/net/cookies_test.html","closure/goog/net/crossdomainrpc_test.html","closure/goog/net/iframeio_different_base_test.html","closure/goog/net/iframeio_test.html","closure/goog/net/iframeloadmonitor_test.html","closure/goog/net/iframe_xhr_test.html","closure/goog/net/imageloader_test.html","closure/goog/net/jsonp_test.html","closure/goog/net/mockxhrlite_test.html","closure/goog/net/multiiframeloadmonitor_test.html","closure/goog/net/networktester_test.html","closure/goog/net/xhrio_test.html","closure/goog/net/xhrlite_test.html","closure/goog/net/xhrmonitor_test.html","closure/goog/net/xpc/crosspagechannel_test.html","closure/goog/net/xpc/nativemessagingtransport_test.html","closure/goog/object/object_test.html","closure/goog/positioning/anchoredviewportposition_test.html","closure/goog/positioning/positioning_test.html","closure/goog/positioning/viewportclientposition_test.html","closure/goog/proto2/descriptor_test.html","closure/goog/proto2/fielddescriptor_test.html","closure/goog/proto2/message_test.html","closure/goog/proto2/objectserializer_test.html","closure/goog/proto2/pbliteserializer_test.html","closure/goog/proto2/proto_test.html","closure/goog/proto/serializer_test.html","closure/goog/pubsub/pubsub_test.html","closure/goog/spell/spellcheck_test.html","closure/goog/string/path_test.html","closure/goog/string/stringbuffer_test.html","closure/goog/string/stringformat_test.html","closure/goog/string/string_test.html","closure/goog/structs/avltree_test.html","closure/goog/structs/circularbuffer_test.html","closure/goog/structs/heap_test.html","closure/goog/structs/inversionmap_test.html","closure/goog/structs/linkedmap_test.html","closure/goog/structs/map_test.html","closure/goog/structs/pool_test.html","closure/goog/structs/prioritypool_test.html","closure/goog/structs/priorityqueue_test.html","closure/goog/structs/quadtree_test.html","closure/goog/structs/queue_test.html","closure/goog/structs/set_test.html","closure/goog/structs/stringset_test.html","closure/goog/structs/structs_test.html","closure/goog/structs/treenode_test.html","closure/goog/structs/trie_test.html","closure/goog/style/cursor_test.html","closure/goog/style/style_quirks_test.html","closure/goog/style/style_test.html","closure/goog/testing/asserts_test.html","closure/goog/testing/async/mockcontrol_test.html","closure/goog/testing/asynctestcase_async_test.html","closure/goog/testing/asynctestcase_noasync_test.html","closure/goog/testing/benchmarks/jsbinarysizebutton_test.html","closure/goog/testing/benchmarks/jsbinarysizetoolbar_test.html","closure/goog/testing/continuationtestcase_test.html","closure/goog/testing/deferredtestcase_test.html","closure/goog/testing/dom_test.html","closure/goog/testing/editor/dom_test.html","closure/goog/testing/editor/testhelper_test.html","closure/goog/testing/events/eventobserver_test.html","closure/goog/testing/events/events_test.html","closure/goog/testing/events/matchers_test.html","closure/goog/testing/expectedfailures_test.html","closure/goog/testing/fs/blob_test.html","closure/goog/testing/fs/directoryentry_test.html","closure/goog/testing/fs/entry_test.html","closure/goog/testing/fs/fileentry_test.html","closure/goog/testing/fs/filewriter_test.html","closure/goog/testing/fs/fs_test.html","closure/goog/testing/fs/integration_test.html","closure/goog/testing/functionmock_test.html","closure/goog/testing/loosemock_test.html","closure/goog/testing/mockclassfactory_test.html","closure/goog/testing/mockclock_test.html","closure/goog/testing/mockcontrol_test.html","closure/goog/testing/mockmatchers_test.html","closure/goog/testing/mockrandom_test.html","closure/goog/testing/mockrange_test.html","closure/goog/testing/mock_test.html","closure/goog/testing/mockuseragent_test.html","closure/goog/testing/net/xhrio_test.html","closure/goog/testing/performancetimer_test.html","closure/goog/testing/propertyreplacer_test.html","closure/goog/testing/pseudorandom_test.html","closure/goog/testing/recordfunction_test.html","closure/goog/testing/singleton_test.html","closure/goog/testing/stacktrace_test.html","closure/goog/testing/strictmock_test.html","closure/goog/testing/style/layoutasserts_test.html","closure/goog/testing/ui/rendererasserts_test.html","closure/goog/testing/ui/style_test.html","closure/goog/timer/timer_test.html","closure/goog/tweak/entries_test.html","closure/goog/tweak/registry_test.html","closure/goog/tweak/tweakui_test.html","closure/goog/ui/activitymonitor_test.html","closure/goog/ui/advancedtooltip_test.html","closure/goog/ui/autocomplete/arraymatcher_test.html","closure/goog/ui/autocomplete/autocomplete_test.html","closure/goog/ui/autocomplete/basic_test.html","closure/goog/ui/autocomplete/inputhandler_test.html","closure/goog/ui/autocomplete/remotearraymatcher_test.html","closure/goog/ui/autocomplete/renderer_test.html","closure/goog/ui/buttonrenderer_test.html","closure/goog/ui/button_test.html","closure/goog/ui/checkbox_test.html","closure/goog/ui/colorbutton_test.html","closure/goog/ui/colormenubuttonrenderer_test.html","closure/goog/ui/colorpalette_test.html","closure/goog/ui/combobox_test.html","closure/goog/ui/component_test.html","closure/goog/ui/containerrenderer_test.html","closure/goog/ui/containerscroller_test.html","closure/goog/ui/container_test.html","closure/goog/ui/controlrenderer_test.html","closure/goog/ui/control_test.html","closure/goog/ui/cookieeditor_test.html","closure/goog/ui/customcolorpalette_test.html","closure/goog/ui/datepicker_test.html","closure/goog/ui/decorate_test.html","closure/goog/ui/dialog_test.html","closure/goog/ui/dimensionpicker_test.html","closure/goog/ui/editor/abstractdialog_test.html","closure/goog/ui/editor/bubble_test.html","closure/goog/ui/editor/linkdialog_test.html","closure/goog/ui/editor/toolbarfactory_test.html","closure/goog/ui/emoji/emojipicker_test.html","closure/goog/ui/emoji/popupemojipicker_test.html","closure/goog/ui/emoji/spriteinfo_test.html","closure/goog/ui/filteredmenu_test.html","closure/goog/ui/formpost_test.html","closure/goog/ui/hovercard_test.html","closure/goog/ui/hsvapalette_test.html","closure/goog/ui/hsvpalette_test.html","closure/goog/ui/idletimer_test.html","closure/goog/ui/iframemask_test.html","closure/goog/ui/inputdatepicker_test.html","closure/goog/ui/keyboardshortcuthandler_test.html","closure/goog/ui/media/flashobject_test.html","closure/goog/ui/media/flickr_test.html","closure/goog/ui/media/media_test.html","closure/goog/ui/media/mp3_test.html","closure/goog/ui/media/photo_test.html","closure/goog/ui/media/picasa_test.html","closure/goog/ui/media/vimeo_test.html","closure/goog/ui/media/youtube_test.html","closure/goog/ui/menubuttonrenderer_test.html","closure/goog/ui/menubutton_test.html","closure/goog/ui/menuitemrenderer_test.html","closure/goog/ui/menuitem_test.html","closure/goog/ui/menu_test.html","closure/goog/ui/nativebuttonrenderer_test.html","closure/goog/ui/plaintextspellchecker_test.html","closure/goog/ui/popupbase_test.html","closure/goog/ui/popupcolorpicker_test.html","closure/goog/ui/popupmenu_test.html","closure/goog/ui/popup_test.html","closure/goog/ui/prompt_test.html","closure/goog/ui/rangemodel_test.html","closure/goog/ui/registry_test.html","closure/goog/ui/richtextspellchecker_test.html","closure/goog/ui/roundedpanel_test.html","closure/goog/ui/scrollfloater_test.html","closure/goog/ui/selectionmenubutton_test.html","closure/goog/ui/select_test.html","closure/goog/ui/serverchart_test.html","closure/goog/ui/sliderbase_test.html","closure/goog/ui/splitbehavior_test.html","closure/goog/ui/splitpane_test.html","closure/goog/ui/style/app/buttonrenderer_test.html","closure/goog/ui/style/app/menubuttonrenderer_test.html","closure/goog/ui/style/app/primaryactionbuttonrenderer_test.html","closure/goog/ui/submenu_test.html","closure/goog/ui/tabbarrenderer_test.html","closure/goog/ui/tabbar_test.html","closure/goog/ui/tablesorter_test.html","closure/goog/ui/tabpane_test.html","closure/goog/ui/tabrenderer_test.html","closure/goog/ui/tab_test.html","closure/goog/ui/textarea_test.html","closure/goog/ui/toolbarcolormenubuttonrenderer_test.html","closure/goog/ui/tree/basenode_test.html","closure/goog/ui/tree/treecontrol_test.html","closure/goog/ui/tree/typeahead_test.html","closure/goog/ui/zippy_test.html","closure/goog/uri/uri_test.html","closure/goog/uri/utils_test.html","closure/goog/useragent/adobereader_test.html","closure/goog/useragent/flash_test.html","closure/goog/useragent/jscript_test.html","closure/goog/useragent/platform_test.html","closure/goog/useragent/product_test.html","closure/goog/useragent/useragent_test.html","closure/goog/window/window_test.html","third_party/closure/goog/dojo/dom/query_test.html","third_party/closure/goog/loremipsum/text/loremipsum_test.html","third_party/closure/goog/mochikit/async/deferredlist_test.html","third_party/closure/goog/mochikit/async/deferred_test.html"];
16
+ "closure/goog/array/array_test.html","closure/goog/asserts/asserts_test.html","closure/goog/async/conditionaldelay_test.html","closure/goog/async/delay_test.html","closure/goog/async/throttle_test.html","closure/goog/base_test.html","closure/goog/color/alpha_test.html","closure/goog/color/color_test.html","closure/goog/crypt/arc4_test.html","closure/goog/crypt/base64_test.html","closure/goog/crypt/basen_test.html","closure/goog/crypt/crypt_test.html","closure/goog/crypt/hash32_test.html","closure/goog/crypt/sha1_test.html","closure/goog/cssom/cssom_test.html","closure/goog/cssom/iframe/style_test.html","closure/goog/datasource/datasource_test.html","closure/goog/datasource/expr_test.html","closure/goog/datasource/fastdatanode_test.html","closure/goog/datasource/jsxmlhttpdatasource_test.html","closure/goog/date/daterange_test.html","closure/goog/date/date_test.html","closure/goog/date/relative_test.html","closure/goog/date/utcdatetime_test.html","closure/goog/debug/debug_test.html","closure/goog/debug/devcss/devcss_test.html","closure/goog/debug/enhanceerror_test.html","closure/goog/debug/entrypointregistry_test.html","closure/goog/debug/errorhandler_async_test.html","closure/goog/debug/errorhandler_test.html","closure/goog/debug/errorreporter_test.html","closure/goog/debug/error_test.html","closure/goog/debug/logbuffer_test.html","closure/goog/debug/logger_test.html","closure/goog/debug/reflect_test.html","closure/goog/debug/tracer_test.html","closure/goog/disposable/disposable_test.html","closure/goog/dom/a11y_test.html","closure/goog/dom/abstractrange_test.html","closure/goog/dom/annotate_test.html","closure/goog/dom/browserrange/browserrange_test.html","closure/goog/dom/classes_test.html","closure/goog/dom/controlrange_test.html","closure/goog/dom/dataset_test.html","closure/goog/dom/dom_quirks_test.html","closure/goog/dom/dom_test.html","closure/goog/dom/fontsizemonitor_test.html","closure/goog/dom/forms_test.html","closure/goog/dom/iframe_test.html","closure/goog/dom/iter_test.html","closure/goog/dom/multirange_test.html","closure/goog/dom/nodeiterator_test.html","closure/goog/dom/nodeoffset_test.html","closure/goog/dom/pattern/matcher_test.html","closure/goog/dom/pattern/pattern_test.html","closure/goog/dom/range_test.html","closure/goog/dom/savedcaretrange_test.html","closure/goog/dom/savedrange_test.html","closure/goog/dom/selection_test.html","closure/goog/dom/tagiterator_test.html","closure/goog/dom/tagname_test.html","closure/goog/dom/textrangeiterator_test.html","closure/goog/dom/textrange_test.html","closure/goog/dom/viewportsizemonitor_test.html","closure/goog/dom/xml_test.html","closure/goog/editor/clicktoeditwrapper_test.html","closure/goog/editor/field_test.html","closure/goog/editor/focus_test.html","closure/goog/editor/icontent_test.html","closure/goog/editor/link_test.html","closure/goog/editor/node_test.html","closure/goog/editor/plugins/abstractbubbleplugin_test.html","closure/goog/editor/plugins/abstractdialogplugin_test.html","closure/goog/editor/plugins/abstracttabhandler_test.html","closure/goog/editor/plugins/basictextformatter_test.html","closure/goog/editor/plugins/blockquote_test.html","closure/goog/editor/plugins/emoticons_test.html","closure/goog/editor/plugins/enterhandler_test.html","closure/goog/editor/plugins/headerformatter_test.html","closure/goog/editor/plugins/linkbubble_test.html","closure/goog/editor/plugins/linkdialogplugin_test.html","closure/goog/editor/plugins/listtabhandler_test.html","closure/goog/editor/plugins/loremipsum_test.html","closure/goog/editor/plugins/removeformatting_test.html","closure/goog/editor/plugins/spacestabhandler_test.html","closure/goog/editor/plugins/tableeditor_test.html","closure/goog/editor/plugins/tagonenterhandler_test.html","closure/goog/editor/plugins/undoredomanager_test.html","closure/goog/editor/plugins/undoredostate_test.html","closure/goog/editor/plugins/undoredo_test.html","closure/goog/editor/plugin_test.html","closure/goog/editor/range_test.html","closure/goog/editor/seamlessfield_quirks_test.html","closure/goog/editor/seamlessfield_test.html","closure/goog/editor/style_test.html","closure/goog/editor/table_test.html","closure/goog/events/actioneventwrapper_test.html","closure/goog/events/actionhandler_test.html","closure/goog/events/browserevent_test.html","closure/goog/events/eventhandler_test.html","closure/goog/events/events_test.html","closure/goog/events/eventtarget_test.html","closure/goog/events/event_test.html","closure/goog/events/filedrophandler_test.html","closure/goog/events/imehandler_test.html","closure/goog/events/keycodes_test.html","closure/goog/events/keyhandler_test.html","closure/goog/events/mousewheelhandler_test.html","closure/goog/events/onlinelistener_test.html","closure/goog/events/pastehandler_test.html","closure/goog/format/emailaddress_test.html","closure/goog/format/format_test.html","closure/goog/format/htmlprettyprinter_test.html","closure/goog/format/jsonprettyprinter_test.html","closure/goog/fs/fs_test.html","closure/goog/functions/functions_test.html","closure/goog/fx/abstractdragdrop_test.html","closure/goog/fx/cssspriteanimation_test.html","closure/goog/fx/dragdropgroup_test.html","closure/goog/fx/dragger_test.html","closure/goog/fx/draglistgroup_test.html","closure/goog/fx/dragscrollsupport_test.html","closure/goog/fx/fx_test.html","closure/goog/gears/basestore_test.html","closure/goog/gears/database_test.html","closure/goog/gears/fakeworkerpool_test.html","closure/goog/gears/gears_test.html","closure/goog/gears/loggerclient_test.html","closure/goog/gears/loggerserver_test.html","closure/goog/gears/logstore_test.html","closure/goog/gears/managedresourcestore_test.html","closure/goog/gears/multipartformdata_test.html","closure/goog/gears/urlcapture_test.html","closure/goog/gears/workerchannel_test.html","closure/goog/gears/workerpool_test.html","closure/goog/graphics/affinetransform_test.html","closure/goog/graphics/ext/coordinates_test.html","closure/goog/graphics/ext/element_test.html","closure/goog/graphics/ext/path_test.html","closure/goog/graphics/paths_test.html","closure/goog/graphics/path_test.html","closure/goog/history/html5history_test.html","closure/goog/i18n/bidiformatter_test.html","closure/goog/i18n/bidi_test.html","closure/goog/i18n/charlistdecompressor_test.html","closure/goog/i18n/currency_test.html","closure/goog/i18n/datetimeformat_test.html","closure/goog/i18n/datetimeparse_test.html","closure/goog/i18n/graphemebreak_test.html","closure/goog/i18n/messageformat_test.html","closure/goog/i18n/mime_test.html","closure/goog/i18n/numberformat_test.html","closure/goog/i18n/timezone_test.html","closure/goog/i18n/uchar_test.html","closure/goog/iter/iter_test.html","closure/goog/json/json_test.html","closure/goog/locale/countrylanguagenames_test.html","closure/goog/locale/genericfontnames_test.html","closure/goog/locale/timezonedetection_test.html","closure/goog/locale/timezonelist_test.html","closure/goog/math/bezier_test.html","closure/goog/math/box_test.html","closure/goog/math/coordinate3_test.html","closure/goog/math/coordinate_test.html","closure/goog/math/integer_test.html","closure/goog/math/line_test.html","closure/goog/math/long_test.html","closure/goog/math/math_test.html","closure/goog/math/matrix_test.html","closure/goog/math/rangeset_test.html","closure/goog/math/range_test.html","closure/goog/math/rect_test.html","closure/goog/math/size_test.html","closure/goog/math/vec2_test.html","closure/goog/math/vec3_test.html","closure/goog/memoize/memoize_test.html","closure/goog/messaging/abstractchannel_test.html","closure/goog/messaging/bufferedchannel_test.html","closure/goog/messaging/deferredchannel_test.html","closure/goog/messaging/loggerclient_test.html","closure/goog/messaging/loggerserver_test.html","closure/goog/messaging/messaging_test.html","closure/goog/messaging/multichannel_test.html","closure/goog/messaging/portcaller_test.html","closure/goog/messaging/portchannel_test.html","closure/goog/messaging/portnetwork_test.html","closure/goog/messaging/portoperator_test.html","closure/goog/module/moduleinfo_test.html","closure/goog/module/moduleloadcallback_test.html","closure/goog/module/moduleloader_test.html","closure/goog/module/modulemanager_test.html","closure/goog/net/browserchannel_test.html","closure/goog/net/bulkloader_test.html","closure/goog/net/channelrequest_test.html","closure/goog/net/cookies_test.html","closure/goog/net/crossdomainrpc_test.html","closure/goog/net/iframeio_different_base_test.html","closure/goog/net/iframeio_test.html","closure/goog/net/iframeloadmonitor_test.html","closure/goog/net/iframe_xhr_test.html","closure/goog/net/imageloader_test.html","closure/goog/net/jsonp_test.html","closure/goog/net/mockxhrlite_test.html","closure/goog/net/multiiframeloadmonitor_test.html","closure/goog/net/networktester_test.html","closure/goog/net/xhrio_test.html","closure/goog/net/xhrlite_test.html","closure/goog/net/xhrmonitor_test.html","closure/goog/net/xpc/crosspagechannel_test.html","closure/goog/net/xpc/nativemessagingtransport_test.html","closure/goog/object/object_test.html","closure/goog/positioning/anchoredviewportposition_test.html","closure/goog/positioning/positioning_test.html","closure/goog/positioning/viewportclientposition_test.html","closure/goog/proto2/descriptor_test.html","closure/goog/proto2/fielddescriptor_test.html","closure/goog/proto2/message_test.html","closure/goog/proto2/objectserializer_test.html","closure/goog/proto2/pbliteserializer_test.html","closure/goog/proto2/proto_test.html","closure/goog/proto/serializer_test.html","closure/goog/pubsub/pubsub_test.html","closure/goog/spell/spellcheck_test.html","closure/goog/string/path_test.html","closure/goog/string/stringbuffer_test.html","closure/goog/string/stringformat_test.html","closure/goog/string/string_test.html","closure/goog/structs/avltree_test.html","closure/goog/structs/circularbuffer_test.html","closure/goog/structs/heap_test.html","closure/goog/structs/inversionmap_test.html","closure/goog/structs/linkedmap_test.html","closure/goog/structs/map_test.html","closure/goog/structs/pool_test.html","closure/goog/structs/prioritypool_test.html","closure/goog/structs/priorityqueue_test.html","closure/goog/structs/quadtree_test.html","closure/goog/structs/queue_test.html","closure/goog/structs/set_test.html","closure/goog/structs/stringset_test.html","closure/goog/structs/structs_test.html","closure/goog/structs/treenode_test.html","closure/goog/structs/trie_test.html","closure/goog/style/cursor_test.html","closure/goog/style/style_quirks_test.html","closure/goog/style/style_test.html","closure/goog/testing/asserts_test.html","closure/goog/testing/async/mockcontrol_test.html","closure/goog/testing/asynctestcase_async_test.html","closure/goog/testing/asynctestcase_noasync_test.html","closure/goog/testing/benchmarks/jsbinarysizebutton_test.html","closure/goog/testing/benchmarks/jsbinarysizetoolbar_test.html","closure/goog/testing/continuationtestcase_test.html","closure/goog/testing/deferredtestcase_test.html","closure/goog/testing/dom_test.html","closure/goog/testing/editor/dom_test.html","closure/goog/testing/editor/testhelper_test.html","closure/goog/testing/events/eventobserver_test.html","closure/goog/testing/events/events_test.html","closure/goog/testing/events/matchers_test.html","closure/goog/testing/expectedfailures_test.html","closure/goog/testing/fs/blob_test.html","closure/goog/testing/fs/directoryentry_test.html","closure/goog/testing/fs/entry_test.html","closure/goog/testing/fs/fileentry_test.html","closure/goog/testing/fs/filewriter_test.html","closure/goog/testing/fs/fs_test.html","closure/goog/testing/fs/integration_test.html","closure/goog/testing/functionmock_test.html","closure/goog/testing/loosemock_test.html","closure/goog/testing/mockclassfactory_test.html","closure/goog/testing/mockclock_test.html","closure/goog/testing/mockcontrol_test.html","closure/goog/testing/mockmatchers_test.html","closure/goog/testing/mockrandom_test.html","closure/goog/testing/mockrange_test.html","closure/goog/testing/mock_test.html","closure/goog/testing/mockuseragent_test.html","closure/goog/testing/net/xhrio_test.html","closure/goog/testing/performancetimer_test.html","closure/goog/testing/propertyreplacer_test.html","closure/goog/testing/pseudorandom_test.html","closure/goog/testing/recordfunction_test.html","closure/goog/testing/singleton_test.html","closure/goog/testing/stacktrace_test.html","closure/goog/testing/strictmock_test.html","closure/goog/testing/style/layoutasserts_test.html","closure/goog/testing/ui/rendererasserts_test.html","closure/goog/testing/ui/style_test.html","closure/goog/timer/timer_test.html","closure/goog/tweak/entries_test.html","closure/goog/tweak/registry_test.html","closure/goog/tweak/tweakui_test.html","closure/goog/ui/activitymonitor_test.html","closure/goog/ui/advancedtooltip_test.html","closure/goog/ui/autocomplete/arraymatcher_test.html","closure/goog/ui/autocomplete/autocomplete_test.html","closure/goog/ui/autocomplete/basic_test.html","closure/goog/ui/autocomplete/inputhandler_test.html","closure/goog/ui/autocomplete/remotearraymatcher_test.html","closure/goog/ui/autocomplete/renderer_test.html","closure/goog/ui/buttonrenderer_test.html","closure/goog/ui/button_test.html","closure/goog/ui/checkbox_test.html","closure/goog/ui/colorbutton_test.html","closure/goog/ui/colormenubuttonrenderer_test.html","closure/goog/ui/colorpalette_test.html","closure/goog/ui/combobox_test.html","closure/goog/ui/component_test.html","closure/goog/ui/containerrenderer_test.html","closure/goog/ui/containerscroller_test.html","closure/goog/ui/container_test.html","closure/goog/ui/controlrenderer_test.html","closure/goog/ui/control_test.html","closure/goog/ui/cookieeditor_test.html","closure/goog/ui/customcolorpalette_test.html","closure/goog/ui/datepicker_test.html","closure/goog/ui/decorate_test.html","closure/goog/ui/dialog_test.html","closure/goog/ui/dimensionpicker_test.html","closure/goog/ui/editor/abstractdialog_test.html","closure/goog/ui/editor/bubble_test.html","closure/goog/ui/editor/linkdialog_test.html","closure/goog/ui/editor/toolbarfactory_test.html","closure/goog/ui/emoji/emojipicker_test.html","closure/goog/ui/emoji/popupemojipicker_test.html","closure/goog/ui/emoji/spriteinfo_test.html","closure/goog/ui/filteredmenu_test.html","closure/goog/ui/formpost_test.html","closure/goog/ui/hovercard_test.html","closure/goog/ui/hsvapalette_test.html","closure/goog/ui/hsvpalette_test.html","closure/goog/ui/idletimer_test.html","closure/goog/ui/iframemask_test.html","closure/goog/ui/inputdatepicker_test.html","closure/goog/ui/keyboardshortcuthandler_test.html","closure/goog/ui/media/flashobject_test.html","closure/goog/ui/media/flickr_test.html","closure/goog/ui/media/media_test.html","closure/goog/ui/media/mp3_test.html","closure/goog/ui/media/photo_test.html","closure/goog/ui/media/picasa_test.html","closure/goog/ui/media/vimeo_test.html","closure/goog/ui/media/youtube_test.html","closure/goog/ui/menubuttonrenderer_test.html","closure/goog/ui/menubutton_test.html","closure/goog/ui/menuitemrenderer_test.html","closure/goog/ui/menuitem_test.html","closure/goog/ui/menu_test.html","closure/goog/ui/nativebuttonrenderer_test.html","closure/goog/ui/plaintextspellchecker_test.html","closure/goog/ui/popupbase_test.html","closure/goog/ui/popupcolorpicker_test.html","closure/goog/ui/popupmenu_test.html","closure/goog/ui/popup_test.html","closure/goog/ui/prompt_test.html","closure/goog/ui/rangemodel_test.html","closure/goog/ui/registry_test.html","closure/goog/ui/richtextspellchecker_test.html","closure/goog/ui/roundedpanel_test.html","closure/goog/ui/scrollfloater_test.html","closure/goog/ui/selectionmenubutton_test.html","closure/goog/ui/select_test.html","closure/goog/ui/serverchart_test.html","closure/goog/ui/sliderbase_test.html","closure/goog/ui/splitbehavior_test.html","closure/goog/ui/splitpane_test.html","closure/goog/ui/style/app/buttonrenderer_test.html","closure/goog/ui/style/app/menubuttonrenderer_test.html","closure/goog/ui/style/app/primaryactionbuttonrenderer_test.html","closure/goog/ui/submenu_test.html","closure/goog/ui/tabbarrenderer_test.html","closure/goog/ui/tabbar_test.html","closure/goog/ui/tablesorter_test.html","closure/goog/ui/tabpane_test.html","closure/goog/ui/tabrenderer_test.html","closure/goog/ui/tab_test.html","closure/goog/ui/textarea_test.html","closure/goog/ui/toolbarcolormenubuttonrenderer_test.html","closure/goog/ui/tree/basenode_test.html","closure/goog/ui/tree/treecontrol_test.html","closure/goog/ui/tree/typeahead_test.html","closure/goog/ui/zippy_test.html","closure/goog/uri/uri_test.html","closure/goog/uri/utils_test.html","closure/goog/useragent/adobereader_test.html","closure/goog/useragent/flash_test.html","closure/goog/useragent/jscript_test.html","closure/goog/useragent/platform_test.html","closure/goog/useragent/product_test.html","closure/goog/useragent/useragent_test.html","closure/goog/window/window_test.html","third_party/closure/goog/dojo/dom/query_test.html","third_party/closure/goog/loremipsum/text/loremipsum_test.html","third_party/closure/goog/mochikit/async/deferredlist_test.html","third_party/closure/goog/mochikit/async/deferred_test.html"];
@@ -94,8 +94,12 @@ goog.debug.reflect.init_ = function() {
94
94
  goog.debug.reflect.registerType_('Function', Function);
95
95
  goog.debug.reflect.registerType_('Number', Number);
96
96
  goog.debug.reflect.registerType_('Object', Object);
97
- goog.debug.reflect.registerType_('RegExp', RegExp);
98
97
  goog.debug.reflect.registerType_('String', String);
98
+
99
+ // The compiler gets upset if we alias regexp directly, because
100
+ // then it can't optimize regexps as well. Just be sneaky about it,
101
+ // because this is only for debugging.
102
+ goog.debug.reflect.registerType_('RegExp', goog.global['RegExp']);
99
103
  };
100
104
 
101
105
 
@@ -305,8 +305,13 @@ goog.addDependency('messaging/loggerserver.js', ['goog.messaging.LoggerServer'],
305
305
  goog.addDependency('messaging/messagechannel.js', ['goog.messaging.MessageChannel'], []);
306
306
  goog.addDependency('messaging/messaging.js', ['goog.messaging'], ['goog.messaging.MessageChannel']);
307
307
  goog.addDependency('messaging/multichannel.js', ['goog.messaging.MultiChannel', 'goog.messaging.MultiChannel.VirtualChannel'], ['goog.Disposable', 'goog.debug.Logger', 'goog.events.EventHandler', 'goog.messaging.MessageChannel', 'goog.object']);
308
+ goog.addDependency('messaging/portcaller.js', ['goog.messaging.PortCaller'], ['goog.Disposable', 'goog.async.Deferred', 'goog.messaging.DeferredChannel', 'goog.messaging.PortChannel', 'goog.messaging.PortNetwork', 'goog.object']);
308
309
  goog.addDependency('messaging/portchannel.js', ['goog.messaging.PortChannel'], ['goog.array', 'goog.debug', 'goog.debug.Logger', 'goog.dom', 'goog.dom.DomHelper', 'goog.events', 'goog.events.EventType', 'goog.json', 'goog.messaging.AbstractChannel', 'goog.object']);
310
+ goog.addDependency('messaging/portnetwork.js', ['goog.messaging.PortNetwork'], []);
311
+ goog.addDependency('messaging/portoperator.js', ['goog.messaging.PortOperator'], ['goog.Disposable', 'goog.asserts', 'goog.debug.Logger', 'goog.messaging.PortChannel', 'goog.messaging.PortNetwork', 'goog.object']);
309
312
  goog.addDependency('messaging/testdata/portchannel_worker.js', ['goog.messaging.testdata.portchannel_worker'], ['goog.messaging.PortChannel']);
313
+ goog.addDependency('messaging/testdata/portnetwork_worker1.js', ['goog.messaging.testdata.portnetwork_worker1'], ['goog.messaging.PortCaller', 'goog.messaging.PortChannel']);
314
+ goog.addDependency('messaging/testdata/portnetwork_worker2.js', ['goog.messaging.testdata.portnetwork_worker2'], ['goog.messaging.PortCaller', 'goog.messaging.PortChannel']);
310
315
  goog.addDependency('module/abstractmoduleloader.js', ['goog.module.AbstractModuleLoader'], []);
311
316
  goog.addDependency('module/basemodule.js', ['goog.module.BaseModule'], ['goog.Disposable']);
312
317
  goog.addDependency('module/basemoduleloader.js', ['goog.module.BaseModuleLoader'], ['goog.Disposable', 'goog.debug.Logger', 'goog.module.AbstractModuleLoader']);
@@ -433,6 +438,8 @@ goog.addDependency('testing/jsunit.js', ['goog.testing.jsunit'], ['goog.testing.
433
438
  goog.addDependency('testing/loosemock.js', ['goog.testing.LooseExpectationCollection', 'goog.testing.LooseMock'], ['goog.array', 'goog.structs.Map', 'goog.testing.Mock']);
434
439
  goog.addDependency('testing/messaging/mockmessagechannel.js', ['goog.testing.messaging.MockMessageChannel'], ['goog.messaging.AbstractChannel', 'goog.testing.asserts']);
435
440
  goog.addDependency('testing/messaging/mockmessageevent.js', ['goog.testing.messaging.MockMessageEvent'], ['goog.events.BrowserEvent', 'goog.events.EventType', 'goog.testing.events']);
441
+ goog.addDependency('testing/messaging/mockmessageport.js', ['goog.testing.messaging.MockMessagePort'], ['goog.events.EventTarget']);
442
+ goog.addDependency('testing/messaging/mockportnetwork.js', ['goog.testing.messaging.MockPortNetwork'], ['goog.messaging.PortNetwork', 'goog.testing.messaging.MockMessageChannel']);
436
443
  goog.addDependency('testing/mock.js', ['goog.testing.Mock', 'goog.testing.MockExpectation'], ['goog.array', 'goog.testing.JsUnitException', 'goog.testing.MockInterface', 'goog.testing.mockmatchers']);
437
444
  goog.addDependency('testing/mockclassfactory.js', ['goog.testing.MockClassFactory', 'goog.testing.MockClassRecord'], ['goog.array', 'goog.object', 'goog.testing.LooseMock', 'goog.testing.StrictMock', 'goog.testing.TestCase', 'goog.testing.mockmatchers']);
438
445
  goog.addDependency('testing/mockclock.js', ['goog.testing.MockClock'], ['goog.Disposable', 'goog.testing.PropertyReplacer']);
@@ -194,7 +194,10 @@ goog.i18n.MessageFormat.prototype.formatBlock_ = function(
194
194
  case goog.i18n.MessageFormat.BlockType_.SIMPLE:
195
195
  var value = namedParameters[parsedPattern[i].value];
196
196
  goog.asserts.assertString(value, 'Format parameter is undefined.');
197
- result.push(value);
197
+ // Don't push the value yet, it may contain any of # { } in it which
198
+ // will break formatter. Insert a placeholder and replace at the end.
199
+ this.literals_.push(value);
200
+ result.push(this.buildPlaceholder_(this.literals_));
198
201
  break;
199
202
  case goog.i18n.MessageFormat.BlockType_.SELECT:
200
203
  var pattern = parsedPattern[i].value;
@@ -318,6 +318,17 @@ function testPoundShowsNumberMinusOffsetInAllCases() {
318
318
  assertEquals('20', fmt.format({'SOME_NUM': '21'}));
319
319
  }
320
320
 
321
+ function testSpecialCharactersInParamaterDontChangeFormat() {
322
+ var fmt = new goog.i18n.MessageFormat('{SOME_NUM, plural,' +
323
+ 'other {# {GROUP}}}');
324
+
325
+ // Test pound sign.
326
+ assertEquals('10 group#1',
327
+ fmt.format({'SOME_NUM': '10', 'GROUP': 'group#1'}));
328
+ // Test other special characters in parameters, like { and }.
329
+ assertEquals('10 } {', fmt.format({'SOME_NUM': '10', 'GROUP': '} {'}));
330
+ }
331
+
321
332
  </script>
322
333
  </body>
323
334
  </html>
@@ -231,25 +231,6 @@ goog.math.Vec3.distance = goog.math.Coordinate3.distance;
231
231
  goog.math.Vec3.squaredDistance = goog.math.Coordinate3.squaredDistance;
232
232
 
233
233
 
234
- /**
235
- * Returns a new 3x1 matrix object from a given coordinate.
236
- *
237
- * @param {goog.math.Coordinate3} a The coordinate.
238
- * @return {!goog.math.Matrix} A new matrix object.
239
- */
240
- goog.math.Vec3.toMatrix3x1 = goog.math.Coordinate3.toMatrix3x1;
241
-
242
-
243
- /**
244
- * Returns a new 4x1 matrix object from a given coordinate.
245
- *
246
- * @param {goog.math.Coordinate3} a The coordinate.
247
- * @return {!goog.math.Matrix} A new matrix object.
248
- */
249
-
250
- goog.math.Vec3.toMatrix4x1 = goog.math.Coordinate3.toMatrix4x1;
251
-
252
-
253
234
  /**
254
235
  * Compares vectors for equality.
255
236
  *
@@ -0,0 +1,150 @@
1
+ // Copyright 2011 The Closure Library Authors. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS-IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ /**
16
+ * @fileoverview The leaf node of a {@link goog.messaging.PortNetwork}. Callers
17
+ * connect to the operator, and request connections with other contexts from it.
18
+ *
19
+ */
20
+
21
+ goog.provide('goog.messaging.PortCaller');
22
+
23
+ goog.require('goog.Disposable');
24
+ goog.require('goog.async.Deferred');
25
+ goog.require('goog.messaging.DeferredChannel');
26
+ goog.require('goog.messaging.PortChannel');
27
+ goog.require('goog.messaging.PortNetwork'); // interface
28
+ goog.require('goog.object');
29
+
30
+
31
+
32
+ /**
33
+ * The leaf node of a network.
34
+ *
35
+ * @param {!goog.messaging.MessageChannel} operatorPort The channel for
36
+ * communicating with the operator. The other side of this channel should be
37
+ * passed to {@link goog.messaging.PortOperator#addPort}. Must be either a
38
+ * {@link goog.messaging.PortChannel} or a decorator wrapping a PortChannel;
39
+ * in particular, it must be able to send and receive {@link MessagePort}s.
40
+ * @constructor
41
+ * @extends {goog.Disposable}
42
+ * @implements {goog.messaging.PortNetwork}
43
+ */
44
+ goog.messaging.PortCaller = function(operatorPort) {
45
+ goog.base(this);
46
+
47
+ /**
48
+ * The channel to the {@link goog.messaging.PortOperator} for this network.
49
+ *
50
+ * @type {!goog.messaging.MessageChannel}
51
+ * @private
52
+ */
53
+ this.operatorPort_ = operatorPort;
54
+
55
+ /**
56
+ * The collection of channels for communicating with other contexts in the
57
+ * network. Each value can contain a {@link goog.aync.Deferred} and/or a
58
+ * {@link goog.messaging.MessageChannel}.
59
+ *
60
+ * If the value contains a Deferred, then the channel is a
61
+ * {@link goog.messaging.DeferredChannel} wrapping that Deferred. The Deferred
62
+ * will be resolved with a {@link goog.messaging.PortChannel} once we receive
63
+ * the appropriate port from the operator. This is the situation when this
64
+ * caller requests a connection to another context; the DeferredChannel is
65
+ * used to queue up messages until we receive the port from the operator.
66
+ *
67
+ * If the value does not contain a Deferred, then the channel is simply a
68
+ * {@link goog.messaging.PortChannel} communicating with the given context.
69
+ * This is the situation when this context received a port for the other
70
+ * context before it was requested.
71
+ *
72
+ * If a value exists for a given key, it must contain a channel, but it
73
+ * doesn't necessarily contain a Deferred.
74
+ *
75
+ * @type {!Object.<{deferred: goog.async.Deferred,
76
+ * channel: !goog.messaging.MessageChannel}>}
77
+ * @private
78
+ */
79
+ this.connections_ = {};
80
+
81
+ this.operatorPort_.registerService(
82
+ goog.messaging.PortNetwork.GRANT_CONNECTION_SERVICE,
83
+ goog.bind(this.connectionGranted_, this),
84
+ true /* opt_json */);
85
+ };
86
+ goog.inherits(goog.messaging.PortCaller, goog.Disposable);
87
+
88
+
89
+ /** @inheritDoc */
90
+ goog.messaging.PortCaller.prototype.dial = function(name) {
91
+ if (name in this.connections_) {
92
+ return this.connections_[name].channel;
93
+ }
94
+
95
+ this.operatorPort_.send(
96
+ goog.messaging.PortNetwork.REQUEST_CONNECTION_SERVICE, name);
97
+ var deferred = new goog.async.Deferred();
98
+ var channel = new goog.messaging.DeferredChannel(deferred);
99
+ this.connections_[name] = {deferred: deferred, channel: channel};
100
+ return channel;
101
+ };
102
+
103
+
104
+ /**
105
+ * Registers a connection to another context in the network. This is called when
106
+ * the operator sends us one end of a {@link MessageChannel}, either because
107
+ * this caller requested a connection with another context, or because that
108
+ * context requested a connection with this caller.
109
+ *
110
+ * It's possible that the remote context and this one request each other roughly
111
+ * concurrently. The operator doesn't keep track of which contexts have been
112
+ * connected, so it will create two separate {@link MessageChannel}s in this
113
+ * case. However, the first channel created will reach both contexts first, so
114
+ * we simply ignore all connections with a given context after the first.
115
+ *
116
+ * @param {{name: string, port: MessagePort}} args The name of the context
117
+ * being connected and the port connecting the context.
118
+ * @private
119
+ */
120
+ goog.messaging.PortCaller.prototype.connectionGranted_ = function(args) {
121
+ var port = args['port'];
122
+ var entry = this.connections_[args['name']];
123
+ if (entry && (!entry.deferred || entry.deferred.hasFired())) {
124
+ // If two PortCallers request one another at the same time, the operator may
125
+ // send out a channel for connecting them multiple times. Since both callers
126
+ // will receive the first channel's ports first, we can safely ignore and
127
+ // close any future ports.
128
+ port.close();
129
+ } else if (!args['success']) {
130
+ throw Error(args['message']);
131
+ } else {
132
+ port.start();
133
+ var channel = new goog.messaging.PortChannel(port);
134
+ if (entry) {
135
+ entry.deferred.callback(channel);
136
+ } else {
137
+ this.connections_[args['name']] = {channel: channel, deferred: null};
138
+ }
139
+ }
140
+ };
141
+
142
+
143
+ /** @inheritDoc */
144
+ goog.messaging.PortCaller.prototype.disposeInternal = function() {
145
+ goog.dispose(this.operatorPort_);
146
+ goog.object.forEach(this.connections_, goog.dispose);
147
+ delete this.operatorPort_;
148
+ delete this.connections_;
149
+ goog.base(this, 'disposeInternal');
150
+ };
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <!--
4
+ Copyright 2011 The Closure Library Authors. All Rights Reserved.
5
+
6
+ Use of this source code is governed by the Apache License, Version 2.0.
7
+ See the COPYING file for details.
8
+ -->
9
+ <!--
10
+ -->
11
+ <head>
12
+ <title>
13
+ Closure Unit Tests - goog.messaging.PortCaller
14
+ </title>
15
+ <script src="../base.js"></script>
16
+ <script src="../../../third_party/closure/goog/deps.js"></script>
17
+ <script>
18
+ goog.require('goog.events.EventTarget');
19
+ goog.require('goog.messaging.PortCaller');
20
+ goog.require('goog.messaging.PortChannel');
21
+ goog.require('goog.messaging.PortNetwork');
22
+ goog.require('goog.testing.MockControl');
23
+ goog.require('goog.testing.jsunit');
24
+ goog.require('goog.testing.messaging.MockMessageChannel');
25
+ </script>
26
+ </head>
27
+ <body>
28
+ <script>
29
+
30
+ var mockControl;
31
+ var mockChannel;
32
+ var caller;
33
+
34
+ function setUp() {
35
+ mockControl = new goog.testing.MockControl();
36
+ mockChannel = new goog.testing.messaging.MockMessageChannel(mockControl);
37
+ caller = new goog.messaging.PortCaller(mockChannel);
38
+ }
39
+
40
+ function tearDown() {
41
+ goog.dispose(caller);
42
+ mockControl.$verifyAll();
43
+ }
44
+
45
+ function MockMessagePort(index, port) {
46
+ goog.base(this);
47
+ this.index = index;
48
+ this.port = port;
49
+ this.started = false;
50
+ }
51
+ goog.inherits(MockMessagePort, goog.events.EventTarget);
52
+
53
+
54
+ MockMessagePort.prototype.start = function() {
55
+ this.started = true;
56
+ };
57
+
58
+ function testGetPort() {
59
+ mockChannel.send(goog.messaging.PortNetwork.REQUEST_CONNECTION_SERVICE, 'foo');
60
+ mockControl.$replayAll();
61
+ caller.dial('foo');
62
+ }
63
+
64
+ </script>
65
+ </body>
66
+ </html>
@@ -0,0 +1,78 @@
1
+ // Copyright 2011 The Closure Library Authors. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS-IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ /**
16
+ * @fileoverview An interface for classes that connect a collection of HTML5
17
+ * message-passing entities ({@link MessagePort}s, {@link Worker}s, and
18
+ * {@link Window}s) and allow them to seamlessly communicate with one another.
19
+ *
20
+ * Conceptually, a PortNetwork is a collection of JS contexts, such as pages (in
21
+ * or outside of iframes) or web workers. Each context has a unique name, and
22
+ * each one can communicate with any of the others in the same network. This
23
+ * communication takes place through a {@link goog.messaging.PortChannel} that
24
+ * is retrieved via {#link goog.messaging.PortNetwork#dial}.
25
+ *
26
+ * One context (usually the main page) has a
27
+ * {@link goog.messaging.PortOperator}, which is in charge of connecting each
28
+ * context to each other context. All other contexts have
29
+ * {@link goog.messaging.PortCaller}s which connect to the operator.
30
+ *
31
+ */
32
+
33
+ goog.provide('goog.messaging.PortNetwork');
34
+
35
+
36
+
37
+ /**
38
+ * @interface
39
+ */
40
+ goog.messaging.PortNetwork = function() {};
41
+
42
+
43
+ /**
44
+ * Returns a message channel that communicates with the named context. If no
45
+ * such port exists, an error will either be thrown immediately or after a round
46
+ * trip with the operator, depending on whether this pool is the operator or a
47
+ * caller.
48
+ *
49
+ * If context A calls dial('B') and context B calls dial('A'), the two
50
+ * ports returned will be connected to one another.
51
+ *
52
+ * @param {string} name The name of the context to get.
53
+ * @return {goog.messaging.MessageChannel} The channel communicating with the
54
+ * given context. This is either a {@link goog.messaging.PortChannel} or a
55
+ * decorator around a PortChannel, so it's safe to send {@link MessagePorts}
56
+ * across it. This will be disposed along with the PortNetwork.
57
+ */
58
+ goog.messaging.PortNetwork.prototype.dial = function(name) {};
59
+
60
+
61
+ /**
62
+ * The name of the service exported by the operator for creating a connection
63
+ * between two callers.
64
+ *
65
+ * @type {string}
66
+ * @const
67
+ */
68
+ goog.messaging.PortNetwork.REQUEST_CONNECTION_SERVICE = 'requestConnection';
69
+
70
+
71
+ /**
72
+ * The name of the service exported by the callers for adding a connection to
73
+ * another context.
74
+ *
75
+ * @type {string}
76
+ * @const
77
+ */
78
+ goog.messaging.PortNetwork.GRANT_CONNECTION_SERVICE = 'grantConnection';
@@ -0,0 +1,64 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <!--
4
+ Copyright 2011 The Closure Library Authors. All Rights Reserved.
5
+
6
+ Use of this source code is governed by the Apache License, Version 2.0.
7
+ See the COPYING file for details.
8
+ -->
9
+ <!--
10
+ -->
11
+ <head>
12
+ <title>
13
+ Closure Unit Tests - goog.messaging.PortNetwork
14
+ </title>
15
+ <script src="../base.js"></script>
16
+ <script src="../../../third_party/closure/goog/deps.js"></script>
17
+ <script>
18
+ goog.require('goog.events.EventTarget');
19
+ goog.require('goog.messaging.PortChannel');
20
+ goog.require('goog.messaging.PortOperator');
21
+ goog.require('goog.testing.AsyncTestCase');
22
+ goog.require('goog.testing.MockControl');
23
+ goog.require('goog.testing.async.MockControl');
24
+ goog.require('goog.testing.messaging.MockMessageEvent');
25
+ goog.require('goog.testing.jsunit');
26
+ </script>
27
+ </head>
28
+ <body>
29
+ <iframe style="display: none;" name="inner" id="inner"
30
+ src="testdata/portnetwork_inner.html"></iframe>
31
+ <script>
32
+
33
+ var asyncTestCase = goog.testing.AsyncTestCase.createAndInstall();
34
+
35
+ // Use a relatively long timeout because workers can take a while to start up.
36
+ asyncTestCase.stepTimeout = 5 * 1000;
37
+
38
+ function testRouteMessageThroughWorkers() {
39
+ if (!('MessageChannel' in goog.global)) {
40
+ return;
41
+ }
42
+
43
+ var master = new goog.messaging.PortOperator('main');
44
+ master.addPort('worker1', new goog.messaging.PortChannel(
45
+ new Worker('testdata/portnetwork_worker1.js')));
46
+ master.addPort('worker2', new goog.messaging.PortChannel(
47
+ new Worker('testdata/portnetwork_worker2.js')));
48
+ master.addPort(
49
+ 'frame', new goog.messaging.PortChannel(window.frames['inner'], '*'));
50
+
51
+ master.dial('worker1').registerService('result', function(msg) {
52
+ assertArrayEquals(['main', 'worker2', 'frame', 'worker1'], msg);
53
+ master.dispose();
54
+ asyncTestCase.continueTesting();
55
+ }, true);
56
+
57
+ master.dial('worker2').send('sendToFrame', ['main']);
58
+
59
+ asyncTestCase.waitForAsync('routing messages');
60
+ }
61
+
62
+ </script>
63
+ </body>
64
+ </html>