The entire purpose of Object.freeze is that the frozen object *can never be
altered again* (in the ways that freeze restricts, at least). Allowing an
object to be unfrozen would violate that very critical security property.
The same is true with seal and preventExtensions. Once locked down, an
And still one question about `function decorators` . They will be work if
in function parameters uses destructuring?
```
@rttc(PrimitiveNumber, PrimitiveString, PrimitiveBoolean)
function a (b, { c, d }) {}
```
20 февр. 2018 г. 0:13 пользователь "mr.efrem" написал:
> And
Note that if you want to use the Proxy that way you will probably want to
implement the setPrototypeOf and preventExtensions traps as well since,
together with set, defineProperty and deleteProperty, they are the traps
whose associated internal methods can have side effects on the target when
the
On Mon, Feb 19, 2018 at 1:50 PM, Sebastian Malton
wrote:
> I would like to propose that the following be valid since it is a very
> common use case.
>
> ```
> for (const field has in object) {
>
> }
> ```
>
> Would be equivalent to:
>
> ```
> for (const field in
> So, what if there was a way to unfreeze an object in the scope in which the
> object was frozen?
I don't think the behavior of object operations should depend on the scope in
which they are used.
And I could understand undoing [[PreventExtensions]], just switch
[[Extensible]] back to true
And I find it kind of absurd that engines don't yet optimize away the
intermediate array allocation (even though it's literally almost equal
to `for ... in` in performance).
-
Isiah Meadows
m...@isiahmeadows.com
Looking for web consulting? Or a new website?
Send me an email and we can get
That's actually very useful, thanks! I have plenty of cases where I wished
I could pass an object without cloning it to ensure it isn't mutated from
outside. And instead of creating the Proxy right when I will emit an event
(for example), I could just store the proxy somewhere so it is long-lived
And still one question about `function decorators` . They will be work if in
function parameters uses destructuring?
```
@rttc(PrimitiveNumber, PrimitiveString, PrimitiveBoolean)
function a (b, { c, d }) {}
```
Исходное сообщение
От: "T.J. Crowder"
You can just do:
const proxy = new Proxy(obj, {
set() { throw new Error(); },
defineProperty() { throw new Error();},
deleteProperty() { throw new Error(); }
})
this.emit('some:event', proxy)
Though, it seems like an exotic use case.
On Mon, Feb 19, 2018 at 8:56 PM, /#!/JoePea
On Mon, Feb 19, 2018 at 1:15 PM, Isiah Meadows
wrote:
>
> >
> > We can't base a distinction between yes and maybe on whether a
> > zero-width $ assertion is triggered if there are paths to completion
> > that do not pass through that assertion.
> >
> >
> > const re =
"ES classes are about 90% sugar"
"ES classes aren't like traditional classes"
Yes and i just want to more sugar for them - just simple.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
You could use Object.keys, Object.entries, or Object.values on the right
side of `of` instead.
On Feb 19, 2018 11:50, "Sebastian Malton" wrote:
> I would like to propose that the following be valid since it is a very
> common use case.
>
> ```
> for (const field has in
I would like to propose that the following be valid since it is a very common use case. ```for (const field has in object) { }```Would be equivalent to:```for (const field in object) { if (!object.hasOwnPropety(field)) { continue; } }```
I just thought I'd politely point out here that JS isn't a purely OO
language (it's even less so class-based OO - ES classes are about 90%
sugar over prototype-based inheritance\*). Also, C#, the language that
*first* had this kind of syntax, [also doesn't have this][1].
Constructors should be
Inline.
On Mon, Feb 19, 2018 at 12:39 PM, Mike Samuel wrote:
>
>
> On Mon, Feb 19, 2018 at 11:43 AM, Isiah Meadows
> wrote:
>>
>> Yes, and I specifically want the conservative variant - I'd want a
>> "maybe" for "foo" in that example.
>>
>> (For
"why a static factory"
I answered earlier:
<>
Yes, you can, but for me more easy to work with classes.
And i just want to extend the functionality for work with async - that all.
___
On Mon, Feb 19, 2018 at 11:43 AM, Isiah Meadows
wrote:
> Yes, and I specifically want the conservative variant - I'd want a
> "maybe" for "foo" in that example.
>
> (For context, my test framework determines *while running a test*
> whether that test has children, and
I also mentioned in my first message that I offered to do call that symbol
when appears assignmen of variable or const: when appears creating and
assignment parameters of function and also when appears assignment of
result function to the variable or const. I just left it in the single
example.
I gave `fetch` you just for example that function result which I want to
check. Also on the Node.js I wanted be to check results of `http` module.
It just examples of black boxes which impossible to check via decorators
how you offered.
`fetch` I assumed to use with `await`.
19 февр. 2018 г.
I'm still struggling through this thread to see why a static factory
method/function with a private constructor/class doesn't suffice for
this, or in this case, just procedural functions? (That's what I
normally do, [even in ES5][1].)
```js
// filter-img.js
export async function create(path) {
On Mon, Feb 19, 2018 at 4:50 PM, Aleksander Efremov
wrote:
> In my first example you can found what I mean.
Yes, I looked at your first example (and every other example in the thread)
before replying. As it had nothing to do with `fetch`, but you specifically
mentioned
Yes, that's it.
19 февр. 2018 г. 20:53 пользователь "Mike Samuel"
написал:
On Mon, Feb 19, 2018 at 11:50 AM, Aleksander Efremov
wrote:
> In my first example you can found what I mean. There not only function.
> Just instead of that function can be
On Mon, Feb 19, 2018 at 11:50 AM, Aleksander Efremov
wrote:
> In my first example you can found what I mean. There not only function.
> Just instead of that function can be black box results which we must check
> on assignment to const.
>
Are you referring to the use of
In my first example you can found what I mean. There not only function.
Just instead of that function can be black box results which we must check
on assignment to const.
19 февр. 2018 г. 20:42 пользователь "T.J. Crowder" <
tj.crow...@farsightsoftware.com> написал:
> On Mon, Feb 19, 2018 at 4:35
Yes, and I specifically want the conservative variant - I'd want a
"maybe" for "foo" in that example.
(For context, my test framework determines *while running a test*
whether that test has children, and checks whether to allocate them
when defining them. For me, I only need "yes/maybe" and "no",
On Mon, Feb 19, 2018 at 4:35 PM, Aleksander Efremov wrote:
>
> How do you offer to check a assignment of result of `fetch` to
> the variable (const) ? For it also exists decorator?
I'm not sure I know what you mean. If you could provide a code example
of what you're asking
How do you offer to check a assignment of result of `fetch` to the variable
(const) ? For it also exists decorator?
19 февр. 2018 г. 18:25 пользователь "T.J. Crowder" <
tj.crow...@farsightsoftware.com> написал:
On Mon, Feb 19, 2018 at 1:59 PM, Александр Ефремов
wrote:
>
> A
On Mon, Feb 19, 2018 at 9:25 AM, T.J. Crowder <
tj.crow...@farsightsoftware.com> wrote:
> On Mon, Feb 19, 2018 at 1:59 PM, Александр Ефремов
> wrote:
>
> When [decorators][1] land, provided they land with a means of [decorating
> functions][2] (either as part of that proposal
On Mon, Feb 19, 2018 at 1:59 PM, Александр Ефремов
wrote:
>
> A reasons for this proposal:
> 1. I don’t want to use static type checking (Flow or TypeScript)
> because on my experience there more a time spend on the
> describing all types and etc. than it gives favor.
> 2. I
A reasons for this proposal:
1. I don’t want to use static type checking (Flow or TypeScript) because on my
experience there more a time spend on the describing all types and etc. than it
gives favor.
2. I want to validate API payloads and other sources of data when it’s need.
I’m sure that
30 matches
Mail list logo