Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Component-Other

New issue 1942 by [email protected]: Working code from r5687 errors in r5702
https://code.google.com/p/google-caja/issues/detail?id=1942

What revision of the cajoler exhibits the problem?  On what browser and OS?
- Mac OS X
- R5702
- Chrome 38
- Firefox 34

Was working fine in r5687 on all browsers (Chrome 37 and below)

What steps will reproduce the problem?
1.  Pass in tamed object api and run
2.  Reference any tamed object in script
3. Caja throws error such as "Cannot read property 'log' of undefined" for the example below 4. gman.domicile in ses-single-frame.js is undefined and browser throws undefined error - line 26993, r5702

 Q.when(promise, function (compiledFunc) {
      var result = undefined;
      try {
        result = compiledFunc(imports);
      } catch (e) {
gman.domicile.handleUncaughtException(e, gman.getUrl()); <---- gman.domicile undefined - line 26993
      }
      if (opt_runDone) {
        opt_runDone(result);
      }
    }, function (failure) {
      config.console.log('Failed to load guest content: ' + failure);
    });

//// EXAMPLE CODE



load: function (container, contentPath, contentType, content, api, uriPolicy)
            {

                var consoleService = {
                    log: function ()
                    {
                        console.log.apply(console, arguments);
                    }
                };

                caja.markReadOnlyRecord(consoleService);
                caja.markFunction(consoleService.log);
                var tamedConsoleService = caja.tame(consoleService);

                var defer = $q.defer();
                setTimeout(doLoad, 0);
                return defer.promise;

                function doLoad()
                {
                    caja.load(undefined, undefined, function (frame)
                    {
                        defer.notify(frame);
                        var _api = { console: tamedConsoleService};
                        frame.code('/dummy.js',
contentType | | 'application/javascript', 'console.log("1234")' )
                            .api(_api)
                            .run(function ()
                            {
                                defer.resolve();
                            }, function (err)
                            {
                                defer.reject(err);
                            });
                    });
                }
            }

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to