| OLD | NEW |
| (Empty) |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file adheres to closure-compiler conventions in order to enable | |
| 6 // compilation with ADVANCED_OPTIMIZATIONS. In particular, members that are to | |
| 7 // be accessed externally should be specified in this['style'] as opposed to | |
| 8 // this.style because member identifiers are minified by default. | |
| 9 // See http://goo.gl/FwOgy | |
| 10 | |
| 11 goog.provide('__crWeb.core'); | |
| 12 | |
| 13 goog.require('__crWeb.common'); | |
| 14 goog.require('__crWeb.message'); | |
| 15 | |
| 16 /* Beginning of anonymous object. */ | |
| 17 (function() { | |
| 18 __gCrWeb['core'] = {}; | |
| 19 | |
| 20 // JavaScript errors are logged on the main application side. The handler is | |
| 21 // added ASAP to catch any errors in startup. Note this does not appear to | |
| 22 // work in iOS < 5. | |
| 23 window.addEventListener('error', function(event) { | |
| 24 // Sadly, event.filename and event.lineno are always 'undefined' and '0' | |
| 25 // with UIWebView. | |
| 26 __gCrWeb.message.invokeOnHost( | |
| 27 {'command': 'window.error', 'message': event.message.toString()}); | |
| 28 }); | |
| 29 | |
| 30 // Flush the message queue. | |
| 31 if (__gCrWeb.message) { | |
| 32 __gCrWeb.message.invokeQueues(); | |
| 33 } | |
| 34 | |
| 35 }()); // End of anonymous object | |
| OLD | NEW |