Bespin does not load on Chromium Nightly 6.0.481.0 (54433)

3 views
Skip to first unread message

Julian Viereck

unread,
Aug 2, 2010, 9:47:51 AM8/2/10
to traits.js
Hi,

some people complaint over the last few days that Bespin is no longer
working with Chrome/-ium 6. A person tracked down the issue and it
seems to be traits.js related (we use traits.js at some places in
Bespin). Here's the important part of the person's research:

"There is an exeption at bespin.js:8888 with "required" being
undefined

// expose the public API of this module
function Trait(record) {
// calling Trait as a function creates a new atomic trait
return trait(record);
}
Trait.required = freeze(required);
Trait.compose = freeze(compose);
Trait.resolve = freeze(resolve);
Trait.override = freeze(override);

I could fix it by changing traits.js:60

var freeze = Object.freeze || function(obj) { return obj; };

into

var freeze = function(obj) { return obj; };

I don't fully understand the impact. That seems to be some kind of
optimization, which doesn't work with the latest V8."

You find the original post here: http://groups.google.com/group/bespin/browse_thread/thread/a352af48a3168965

Someone else got the error message "Uncaught TypeError: Object.freeze
called on non-object" (original post:
http://groups.google.com/group/bespin/browse_thread/thread/3e418217954d3849).

Is there a way to fix this issue?

Cheers

Julian

Tom Van Cutsem

unread,
Aug 2, 2010, 2:55:03 PM8/2/10
to trai...@googlegroups.com
Hi,

Apparently, the latest v8 doesn't implement Object.freeze (and Object.seal) according to spec. Normally Object.freeze(obj) should return 'obj', but instead it returns 'undefined'.

For now, I created a little workaround as follows:

  var freeze = (Object.freeze ? function(obj) { Object.freeze(obj); return obj; }
                              : function(obj) { return obj; });

I will publish a new version of traits.js with this little patch ASAP.

I filed a bug in V8, hopefully they'll solve this soon:

Thanks for reporting!

Cheers,
Tom

2010/8/2 Julian Viereck <julian....@googlemail.com>

Tom Van Cutsem

unread,
Aug 2, 2010, 3:11:53 PM8/2/10
to trai...@googlegroups.com
traits.js v0.3 contains this patch. My unit tests all pass on the latest v8 (2.3.4.1). Let me know if you encounter further issues.

2010/8/2 Tom Van Cutsem <tvcu...@gmail.com>
Reply all
Reply to author
Forward
0 new messages