Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Unified Diff: src/apinatives.js

Issue 7324027: Fix: FunctionTemplate::SetPrototypeAttributes broke prototype object (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/apinatives.js
diff --git a/src/apinatives.js b/src/apinatives.js
index 193863f5c2f9f99cccb42432b0b6902b47898aff..df530bb0951d903fcb61fe63bdebad79e98c8b9e 100644
--- a/src/apinatives.js
+++ b/src/apinatives.js
@@ -74,13 +74,11 @@ function InstantiateFunction(data, name) {
cache[serialNumber] = fun;
var prototype = %GetTemplateField(data, kApiPrototypeTemplateOffset);
var attributes = %GetTemplateField(data, kApiPrototypeAttributesOffset);
+ fun.prototype = prototype ? Instantiate(prototype) : {};
if (attributes != NONE) {
- %IgnoreAttributesAndSetProperty(
- fun, "prototype",
- prototype ? Instantiate(prototype) : {},
- attributes);
- } else {
- fun.prototype = prototype ? Instantiate(prototype) : {};
+ // This will fail to set the prototype (so we can just pass in '{}'),
+ // but it *will* set its attributes :-)
+ %IgnoreAttributesAndSetProperty(fun, "prototype", {}, attributes);
Mads Ager (chromium) 2011/07/11 10:12:54 Let's create a runtime function %SetPropertyAttrib
}
%SetProperty(fun.prototype, "constructor", fun, DONT_ENUM);
var parent = %GetTemplateField(data, kApiParentTemplateOffset);
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698