Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index fb40d5e73e3c3dd85b15165c88487f6d893cbd5f..3129c930a2e2fcc751271f59865e2c81186f301c 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -4238,6 +4238,27 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) { |
} |
+// Return property without being observable by accessors or interceptors. |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) { |
+ ASSERT(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(String, key, 1); |
+ LookupResult lookup(isolate); |
+ object->LookupRealNamedProperty(*key, &lookup); |
+ if (!lookup.IsProperty()) return isolate->heap()->undefined_value(); |
Sven Panne
2012/11/12 10:14:00
With the change below, this can change to ...!look
|
+ switch (lookup.type()) { |
+ case NORMAL: |
+ return lookup.holder()->GetNormalizedProperty(&lookup); |
+ case FIELD: |
+ return lookup.holder()->FastPropertyAt(lookup.GetFieldIndex()); |
+ case CONSTANT_FUNCTION: |
+ return lookup.GetConstantFunction(); |
+ default: |
Sven Panne
2012/11/12 10:14:00
Please explicitly list all PropertyTypes. We shoul
|
+ return isolate->heap()->undefined_value(); |
+ } |
+} |
+ |
+ |
MaybeObject* Runtime::SetObjectProperty(Isolate* isolate, |
Handle<Object> object, |
Handle<Object> key, |