Skip to content

Bug in Chrome Beta requires WeakMap upgrade #1154

Closed
toji opened this Issue Mar 6, 2013 · 11 comments

4 participants

@toji
toji commented Mar 6, 2013

On a couple of devices that I've tried recently (The Chromebook Pixel and an Ubuntu box) Montage has failed to load any applications, giving the following error:

TypeError: Property 'isExtensible' of object #<Object> is not a function
    at getHiddenRecord (http://montagejs.github.com/montage/core/shim/weak-map.js:270:24)
    at Function.identifyingFreeze (http://montagejs.github.com/montage/core/shim/weak-map.js:305:9)
    at __FILE__http______montagejs__github__com__montage__core__extras__object__ (http://montagejs.github.com/montage/core/extras/object.js:63:19)
    at module.factory (http://montagejs.github.com/montage/montage.js:215:32)
    at getExports (http://montagejs.github.com/montage/require/require.js:217:46)
    at require (http://montagejs.github.com/montage/require/require.js:277:24)
    at __FILE__http______montagejs__github__com__montage__core__core__ (http://montagejs.github.com/montage/core/core.js:46:1)
    at module.factory (http://montagejs.github.com/montage/montage.js:215:32)
    at getExports (http://montagejs.github.com/montage/require/require.js:217:46)
    at getExports (http://montagejs.github.com/montage/require/require.js:192:24) function () {

                dependencies.forEach(montageRequire);

                var EventManager = montageRequire("core/event/event-manager").EventManager;
                var Deserializer = montageRequire("core/deserializer").Deserializer;
                var defaultEventManager, application;

                // Load the event-manager
                defaultEventManager = EventManager.create().initWithWindow(window);

                // montageWillLoad is mostly for testing purposes
                if (typeof global.montageWillLoad === "function") {
                    global.montageWillLoad();
                }

                // Load the application

                var appProto = applicationRequire.packageDescription.applicationPrototype,
                    applicationDescription, appModulePromise;
                if (appProto) {
                    applicationDescription = Deserializer.parseForModuleAndName(appProto);
                    appModulePromise = applicationRequire.async(applicationDescription.module);
                } else {
                    appModulePromise = montageRequire.async("ui/application");
                }

                return appModulePromise.then(function(exports) {
                    application = exports[(applicationDescription ? applicationDescription.name : "Application")].create();
                    window.document.application = application;
                    defaultEventManager.application = application;
                    application.eventManager = defaultEventManager;
                    application._load(applicationRequire, function() {
                        if (params.module) {
                            // If a module was specified in the config then we initialize it now
                            applicationRequire.async(params.module)
                            .end();
                        }
                    });
                })

            } promise.js:462
Should be empty: 
Array[0]
 promise.js:745
Uncaught TypeError: Property 'isExtensible' of object #<Object> is not a function 

Both of the failing devices are running the current Chrome Beta (Version 26.0.1410.19), and I've seen other devices (Macbook and Samsung Chromebook) running Chrome Stable, Dev, or Canary channels working fine, so it's highly likely that this is an issue with the Beta that will be resolved as part of the release process. It's worth keeping an eye out for, though.

@kriskowal
MontageJS member

Thanks for the heads up. Object.isExtensible is an ES5 method and the WeakMap is a module that @erights made. He will be anxious to hear that the method appears to have gone away in a Chrome beta.

@erights
erights commented Mar 6, 2013

This is fixed on es-lab at https://code.google.com/p/es-lab/source/browse/trunk/src/ses/WeakMap.js as of r800. See also https://codereview.appspot.com/7433048/diff/21002/src/com/google/caja/ses/WeakMap.js which is still under review for commitment-to-be to the Caja source tree.

@kriskowal
MontageJS member

Thanks, @erights. We’ll sync.

@erights
erights commented Mar 6, 2013

@toji Have you seen it fail on anything other than a Linux base? Everytime we've encountered this problem, it's always been on a Chrome on Linux. Although the version I mention above avoids this bug, we have not yet actually diagnosed the underlying problem.

@toji
toji commented Mar 7, 2013
@kriskowal kriskowal was assigned Mar 11, 2013
@kriskowal
MontageJS member

I have update the title of the issue and assigned to myself. Thanks.

@toji
toji commented Mar 12, 2013

Is there a way to manually work around this for the moment? It's unfortunately turned into a blocking issue for me.

@kriskowal
MontageJS member

@toji, try replacing our weak-map implementation with the latest https://code.google.com/p/es-lab/source/browse/trunk/src/ses/WeakMap.js

It may require some patching to export the WeakMap as a CommonJS module. You might check the history for the file to see the patches.

@mczepiel mczepiel closed this Jun 14, 2013
@mczepiel mczepiel reopened this Jun 14, 2013
@mczepiel
MontageJS member

Clicked the wrong button, @kriskowal is this something on your radar? The pull request looks sane; though I'm a little confused about the travis failure

@kriskowal
MontageJS member

This is still on my radar.

@kriskowal
MontageJS member

Since this issue was brought up, WeakMap has been factored out into its own package https://github.com/drses/weak-map that I keep in sync with the Caja Subversion. This issue was addressed.

@kriskowal kriskowal closed this May 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.