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

Side by Side Diff: src/objects.cc

Issue 19384004: Proxies: Make 'with' work, plus minor other fixes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | src/proxy.js » ('j') | src/proxy.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3586 matching lines...) Expand 10 before | Expand all | Expand 10 after
3597 3597
3598 bool has_pending_exception; 3598 bool has_pending_exception;
3599 Handle<Object> argv[] = { result }; 3599 Handle<Object> argv[] = { result };
3600 Handle<Object> desc = 3600 Handle<Object> desc =
3601 Execution::Call(isolate->to_complete_property_descriptor(), result, 3601 Execution::Call(isolate->to_complete_property_descriptor(), result,
3602 ARRAY_SIZE(argv), argv, &has_pending_exception); 3602 ARRAY_SIZE(argv), argv, &has_pending_exception);
3603 if (has_pending_exception) return NONE; 3603 if (has_pending_exception) return NONE;
3604 3604
3605 // Convert result to PropertyAttributes. 3605 // Convert result to PropertyAttributes.
3606 Handle<String> enum_n = isolate->factory()->InternalizeOneByteString( 3606 Handle<String> enum_n = isolate->factory()->InternalizeOneByteString(
3607 STATIC_ASCII_VECTOR("enumerable")); 3607 STATIC_ASCII_VECTOR("enumerable_"));
3608 Handle<Object> enumerable(v8::internal::GetProperty(isolate, desc, enum_n)); 3608 Handle<Object> enumerable(v8::internal::GetProperty(isolate, desc, enum_n));
3609 if (isolate->has_pending_exception()) return NONE; 3609 if (isolate->has_pending_exception()) return NONE;
3610 Handle<String> conf_n = isolate->factory()->InternalizeOneByteString( 3610 Handle<String> conf_n = isolate->factory()->InternalizeOneByteString(
3611 STATIC_ASCII_VECTOR("configurable")); 3611 STATIC_ASCII_VECTOR("configurable_"));
3612 Handle<Object> configurable(v8::internal::GetProperty(isolate, desc, conf_n)); 3612 Handle<Object> configurable(v8::internal::GetProperty(isolate, desc, conf_n));
3613 if (isolate->has_pending_exception()) return NONE; 3613 if (isolate->has_pending_exception()) return NONE;
3614 Handle<String> writ_n = isolate->factory()->InternalizeOneByteString( 3614 Handle<String> writ_n = isolate->factory()->InternalizeOneByteString(
3615 STATIC_ASCII_VECTOR("writable")); 3615 STATIC_ASCII_VECTOR("writable_"));
3616 Handle<Object> writable(v8::internal::GetProperty(isolate, desc, writ_n)); 3616 Handle<Object> writable(v8::internal::GetProperty(isolate, desc, writ_n));
3617 if (isolate->has_pending_exception()) return NONE; 3617 if (isolate->has_pending_exception()) return NONE;
3618 if (!writable->BooleanValue()) {
3619 Handle<String> set_n = isolate->factory()->InternalizeOneByteString(
3620 STATIC_ASCII_VECTOR("set_"));
3621 Handle<Object> setter(v8::internal::GetProperty(isolate, desc, set_n));
3622 if (isolate->has_pending_exception()) return NONE;
3623 writable = isolate->factory()->ToBoolean(!setter->IsUndefined());
3624 }
3618 3625
3619 if (configurable->IsFalse()) { 3626 if (configurable->IsFalse()) {
3620 Handle<String> trap = isolate->factory()->InternalizeOneByteString( 3627 Handle<String> trap = isolate->factory()->InternalizeOneByteString(
3621 STATIC_ASCII_VECTOR("getPropertyDescriptor")); 3628 STATIC_ASCII_VECTOR("getPropertyDescriptor"));
3622 Handle<Object> args[] = { handler, trap, name }; 3629 Handle<Object> args[] = { handler, trap, name };
3623 Handle<Object> error = isolate->factory()->NewTypeError( 3630 Handle<Object> error = isolate->factory()->NewTypeError(
3624 "proxy_prop_not_configurable", HandleVector(args, ARRAY_SIZE(args))); 3631 "proxy_prop_not_configurable", HandleVector(args, ARRAY_SIZE(args)));
3625 isolate->Throw(*error); 3632 isolate->Throw(*error);
3626 return NONE; 3633 return NONE;
3627 } 3634 }
(...skipping 12325 matching lines...) Expand 10 before | Expand all | Expand 10 after
15953 15960
15954 void PropertyCell::AddDependentCode(Handle<Code> code) { 15961 void PropertyCell::AddDependentCode(Handle<Code> code) {
15955 Handle<DependentCode> codes = DependentCode::Insert( 15962 Handle<DependentCode> codes = DependentCode::Insert(
15956 Handle<DependentCode>(dependent_code()), 15963 Handle<DependentCode>(dependent_code()),
15957 DependentCode::kPropertyCellChangedGroup, code); 15964 DependentCode::kPropertyCellChangedGroup, code);
15958 if (*codes != dependent_code()) set_dependent_code(*codes); 15965 if (*codes != dependent_code()) set_dependent_code(*codes);
15959 } 15966 }
15960 15967
15961 15968
15962 } } // namespace v8::internal 15969 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/proxy.js » ('j') | src/proxy.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698