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

This works with 5687, broken in 5702+, don't know when it broke as jumped to 5702.

Error:
Uncaught script error: Uncaught TypeError: console is undefined in source: "/dummy.js" at line: -1

<html>
        <head>
        </head>
        <body>
        
        <script type="text/javascript" src="/caja/caja.js"></script>
        <script type="text/javascript">
                caja.initialize({
                        cajaServer: '/caja/',
                        maxAcceptableSeverity: 
'NO_KNOWN_EXPLOIT_SPEC_VIOLATION',
                        debug: true,
                        es5Mode: true
                }, null, function(err)
                {
                        alert('Error');
                });
                caja.whenReady(function()
                {
                        doTest();
                })
                
                function doTest()               
                {
                var consoleService = {
                    log: function ()
                    {
                        console.log.apply(console, arguments);
                    }
                };
                caja.markReadOnlyRecord(consoleService);
                caja.markFunction(consoleService.log);
                var tamedConsoleService = caja.tame(consoleService);
                doLoad()
                function doLoad()
                {
                    caja.load(undefined, undefined, function (frame)
                    {
                        var _api = { console: tamedConsoleService};
frame.code('/dummy.js', 'application/javascript', 'console.log("1234")' )
                            .api(_api)
                            .run(function ()
                            {

                            }, function (err)
                            {

                            });
                    });
                }                               
                }
        </script> 
        </body>
</html>
        

--
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