Commit Graph

2380 Commits

Author SHA1 Message Date
Jason Orendorff
495d3b16a3 Bug 1133081, part 5 - Remove non-asserting PropertyDescriptor accessors in favor of the new PropDesc-inspired asserting accessors. r=efaust.
value() can't assert hasValue() because too many places have plausible reasons for calling it on a PropertyDescriptor they basically know nothing about. One such place is CompartmentChecker::check(Handle<JSPropertyDescriptor>). Another is DefinePropertyByDescriptor. Maybe this will change with time.

In some cases we do things like `desc.hasWritable() && desc.writable() != existing_desc.writable()`. It is OK to write it this way, even though we have not checked existing_desc.hasWritable(), because in these cases we already know existingDesc is a complete property descriptor.
2015-02-15 06:18:30 -06:00
Jason Orendorff
e079c2024a Bug 1133081, part 4 - Reimplement the remaining PropDesc methods and delete PropDesc. r=efaust. 2015-02-14 07:37:13 -06:00
Jason Orendorff
020c2fc3af Bug 1133081, part 3 - Switch from js::PropDesc to JSPropertyDescriptor for more odds and ends. r=efaust. 2015-02-13 19:08:21 -06:00
Jason Orendorff
02195cb3e6 Bug 1133081, part 2 - Switch from js::PropDesc to JSPropertyDescriptor for js::StandardDefineProperty implementation. r=efaust. 2015-02-13 18:52:45 -06:00
Jason Orendorff
84302d018d Bug 1133081, part 1 - Switch from js::PropDesc to JSPropertyDescriptor for all users of js::StandardDefineProperty (mainly Object.defineProperty/Properties and the corresponding Debugger.Object methods). r=efaust. 2015-02-13 14:31:27 -06:00
Boris Zbarsky
efe7bddb93 Bug 1141905 part 4. Add some assertions about what enclosingScope can return for non-scope objects. r=waldo 2015-03-12 21:46:57 -04:00
Brian Hackett
7c55e9926c Bug 1135897 - Use unboxed objects for JSON objects and constant literals embedded in scripts, r=jandem. 2015-03-12 17:09:21 -06:00
Ryan VanderMeulen
5e58127acf Backed out changeset 94f1fc3d9ec8 (bug 1135897) for LSAN leaks.
CLOSED TREE
2015-03-12 15:02:08 -04:00
Jason Orendorff
734794090a Bug 1133085 - PropDesc::initFromPropertyDescriptor should understand JSPROP_GETTER without JSPROP_SETTER and vice versa. r=efaust.
PropDesc and PropertyDescriptor are at last capable of expressing all valid PropertyDescriptors, both complete and incomplete. This should make them pretty much equivalent. But since this came on gradually, there is a lingering bug in the code that translates between the two structs.
2015-02-13 16:25:31 -06:00
Jason Orendorff
f3cc9141af Bug 1133094 - Object.defineProperty() on scripted proxy incorrectly sets {[[Configurable]]: true} if it's missing. r=efaust.
It is not immediately clear why the test has anything to do with the code changes, but the code changes do in fact make that test pass, because they cause us not to generate nonsensical PropDesc/PropertyDescriptor records that confuse our DefineProperty machinery.

The first hunk in jsobj.cpp is the key bit, and the rest is mopping up regressions from that change.
2015-02-13 17:07:08 -06:00
Brian Hackett
e1bc4a5b5b Bug 1135897 - Use unboxed objects for JSON objects and constant literals embedded in scripts, r=jandem. 2015-03-12 10:58:19 -06:00
Boris Zbarsky
81ac0c4f1d Bug 1142282 part 3. Remove the parent argument of NewNativeObjectWithClassProto. r=waldo 2015-03-11 22:33:59 -04:00
Boris Zbarsky
06603ed7a7 Bug 1142282 part 1. Remove the parent argument of NewNativeObjectWithGivenProto. r=waldo 2015-03-11 22:33:59 -04:00
Boris Zbarsky
e0c32ee184 Bug 1142266. Remove the parent argument from js::NewObjectWithProto. r=waldo 2015-03-11 22:33:59 -04:00
Boris Zbarsky
f436c0be1f Bug 1140586 part 5. Split up js::NewFunction into several different APIs that are more clear in terms of what they do and don't need parents as much. r=waldo 2015-03-11 22:33:59 -04:00
Boris Zbarsky
c941f1cd73 Bug 1140586 part 3. Drop the funobjArg of js::NewFunction and js::NewFunctionWithProto. r=waldo 2015-03-11 22:33:59 -04:00
Benjamin Bouvier
4e54760f75 Bug 1140317: include more UniquePtr and more using mozilla::UniquePtr in a CLOSED TREE; r=bustage 2015-03-11 17:32:02 +01:00
Benjamin Bouvier
ffa763022c Bug 1140317: Make sure chars created by DecompileValueGenerator won't ever leak; r=Waldo 2015-03-10 19:34:00 +01:00
Boris Zbarsky
8697b89d94 Bug 1140670 part 3. Add an assertParentIs() for asserting the parent is something specific and use it in various places to eliminate getParent() calls. r=waldo 2015-03-09 12:52:15 -04:00
Boris Zbarsky
2ca18615b2 Bug 1140670 part 2. Just use the global as the parent in js::CreateThis and js::CreateThisForFunctionWithProto. r=waldo 2015-03-09 12:50:56 -04:00
Boris Zbarsky
c42c759354 Bug 1140670 part 1. Just use the global, not the proto's parent, as the default parent in NewObjectWithGivenTaggedProto. r=waldo 2015-03-09 12:50:55 -04:00
Jason Orendorff
7fdeaf63be Bug 1113369, part 7 - [[SetPrototypeOf]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-05 16:36:50 -06:00
Jason Orendorff
6e6ba315a5 Bug 1113369, part 6 - [[PreventExtensions]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-04 12:01:01 -06:00
Jason Orendorff
20beb2cc48 Bug 1113369, part 5 - [[Delete]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-04 10:20:04 -06:00
Jason Orendorff
b180889659 Bug 1113369, part 4 - [[Set]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect. 2015-02-03 19:51:40 -06:00
Jason Orendorff
1d3bb8fb3d Bug 1113369, part 3 - [[DefineOwnProperty]] ObjectOpResult support. r=Waldo, r=bz in dom, r=dvander in js/ipc, r=bholley in js/xpconnect.
Add an ObjectOpResult out-param for DefineProperty functions everywhere. We leave a few js::DefineProperty() convenience functions with no *result out-param. These have strict behavior: that is, they automatically check the result and throw if it is false. In bug 1125624 these strict signatures may end up being called DefinePropertyOrThrow, as that is what the spec calls it.
2015-01-30 11:37:07 -06:00
Jason Orendorff
4a1c7e47a8 Bug 1113369, part 2 - js::SetArrayLength ObjectOpResult support. r=Waldo. 2015-01-29 23:02:26 -06:00
Jason Orendorff
f25a0ce728 Bug 1113369, part 1½ - Avoid regressing error messages by adding obj to the ObjectOpResult methods that could throw a TypeError. r=Waldo. 2015-02-18 18:49:17 -06:00
Jason Orendorff
99eb5c9229 Bug 1113369, part 1 - Introduce JS::ObjectOpResult and use it in js::StandardDefineProperty. r=Waldo.
In general, jsobj.h will offer, for each standard internal method that returns a boolean value indicating success/failure, signatures with a JS::ObjectOpResult& out-parameter and signatures without it. The ones without will throw a TypeError on failure (that is, the behavior will be "strict").
2015-02-02 17:06:47 -06:00
Jason Orendorff
c9cc21f96d Bug 1130576 - Rename JSPropertyOp -> JSGetterOp and JSStrictPropertyOp -> JSSetterOp. r=efaust. 2015-01-30 13:56:15 -06:00
Brian Hackett
ea773cf9f2 Bug 1137497 - Remove shape from unboxed objects, r=jandem. 2015-03-04 08:32:45 -06:00
Brian Hackett
2f072f5964 Bug 1135816 - Handle unboxed object receivers when compiling getter/setter calls in baseline/Ion, r=jandem. 2015-03-03 06:32:27 -06:00
Jan de Mooij
a3c48deed7 Bug 1137523 part 2 - Unprefix a few js_* functions I forgot in part 1. r=bhackett 2015-03-03 09:33:22 +01:00
Terrence Cole
24b216d25d Bug 1135985 - Use typed members to implement pushMarkStack; r=sfink 2015-02-25 13:09:05 -08:00
Tom Tromey
ab1e214700 Bug 1130166 - Use SizePrintfMacros.h when printing line numbers. r=Waldo 2015-02-27 08:19:00 -05:00
Jan de Mooij
b3f1ff13a2 Bug 1137523 - Unprefix most js_* functions. r=bhackett CLOSED TREE 2015-02-27 16:08:15 +01:00
Boris Zbarsky
a051ae3f2a Bug 1136925 part 4. Stop passing parents to ProxyObject::New. r=waldo 2015-02-26 15:58:59 -05:00
Boris Zbarsky
513c8ecf34 Bug 1136925 part 1. Stop passing a parent to JS_CloneObject. r=waldo 2015-02-26 15:58:59 -05:00
Wes Kocher
64ff21e8a1 Backed out 4 changesets (bug 1136925) for potentially busting m-e10s-dt on a CLOSED TREE
Backed out changeset 331761aaae22 (bug 1136925)
Backed out changeset 2faa0e91fe23 (bug 1136925)
Backed out changeset a00f2530c911 (bug 1136925)
Backed out changeset d5e658bc0792 (bug 1136925)
2015-02-26 23:17:34 -08:00
Boris Zbarsky
7be39cc8c9 Bug 1136925 part 4. Stop passing parents to ProxyObject::New. r=waldo 2015-02-26 15:58:59 -05:00
Boris Zbarsky
5947179f5e Bug 1136925 part 1. Stop passing a parent to JS_CloneObject. r=waldo 2015-02-26 15:58:59 -05:00
Brian Hackett
6d117c5436 Bug 1135718 - Convert unboxed plain objects to natives before changing their prototype, r=jandem. 2015-02-25 09:33:04 -06:00
Steve Fink
b45f9c2bfd Bug 1133909 - Fix hazards revealed by adding in new GCPointers, r=terrence 2015-02-24 09:37:13 -08:00
Boris Zbarsky
25fb344752 Bug 1134970 part 2. Add JS friend API to quickly copy properties from one object to another if the objects are similar enough. r=bhackett,waldo 2015-02-24 16:04:22 -05:00
Boris Zbarsky
36b39012f8 Bug 1134969. Make DeepCloneObjectLiteral correctly handle setLastProperty failures. r=waldo 2015-02-24 16:04:22 -05:00
Boris Zbarsky
d8d38e06f2 Bug 1134968. If JS_NewObjectWithGivenProto is passed a null parent and null proto, use the context's current global as the parent. r=waldo 2015-02-24 16:04:22 -05:00
ziyunfei
445a3b1783 Bug 1120170 - part 1 - Change JSMSG_NOT_NONNULL_OBJECT message to accept an argument. r=till 2015-02-22 07:21:00 +01:00
Brian Hackett
f039f15a6a Bug 1133254 - Improve type information and Ion compilation when dealing with converted unboxed objects, r=jandem. 2015-02-21 18:52:50 -06:00
Boris Zbarsky
c61ae2f226 Bug 1134955. Be more careful with how we stringify property ids for error message reporting. r=jorendorff 2015-02-20 14:16:26 -05:00
Terrence Cole
dddb8adb9d Bug 1132706 - Lazify hashing for insertions into the NewObjectCache; r=jonco 2015-02-13 11:36:40 -08:00