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

Unified Diff: src/apinatives.js

Issue 7229007: Add possibility to configure 'prototype' property via FunctionTemplate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 6 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 | « src/api.cc ('k') | src/macros.py » ('j') | no next file with comments »
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 ca2bbf5c5355c53bb39ab249c7941adf284a6a39..193863f5c2f9f99cccb42432b0b6902b47898aff 100644
--- a/src/apinatives.js
+++ b/src/apinatives.js
@@ -73,7 +73,15 @@ function InstantiateFunction(data, name) {
if (name) %FunctionSetName(fun, name);
cache[serialNumber] = fun;
var prototype = %GetTemplateField(data, kApiPrototypeTemplateOffset);
- fun.prototype = prototype ? Instantiate(prototype) : {};
+ var attributes = %GetTemplateField(data, kApiPrototypeAttributesOffset);
+ if (attributes != NONE) {
+ %IgnoreAttributesAndSetProperty(
+ fun, "prototype",
+ prototype ? Instantiate(prototype) : {},
+ attributes);
+ } else {
+ fun.prototype = prototype ? Instantiate(prototype) : {};
+ }
%SetProperty(fun.prototype, "constructor", fun, DONT_ENUM);
var parent = %GetTemplateField(data, kApiParentTemplateOffset);
if (parent) {
« no previous file with comments | « src/api.cc ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698