Author: erik.co...@gmail.com Date: Wed May 6 06:19:55 2009 New Revision: 1884
Modified: branches/bleeding_edge/src/v8natives.js Log: Missing file from last change. TBR=kasperl Modified: branches/bleeding_edge/src/v8natives.js ============================================================================== --- branches/bleeding_edge/src/v8natives.js (original) +++ branches/bleeding_edge/src/v8natives.js Wed May 6 06:19:55 2009 @@ -54,6 +54,16 @@ } } +// Emulates JSC by installing functions on a hidden prototype that +// lies above the current object/prototype. This lets you override +// functions on String.prototype etc. and then restore the old function +// with delete. See http://code.google.com/p/chromium/issues/detail?id=1717 +function InstallFunctionsOnHiddenPrototype(object, attributes, functions) { + var hidden_prototype = new $Object(); + %SetHiddenPrototype(object, hidden_prototype); + InstallFunctions(hidden_prototype, attributes, functions); +} + // ---------------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---