Skip to content

Conversation

@dilijev
Copy link
Contributor

@dilijev dilijev commented Feb 5, 2018

Fixes OS#14101048
Partial fix for #249

@boingoing
Copy link
Contributor

Can't user code define a property named 'caller' or 'arguments' on a library function?

Object.defineProperty(Boolean, 'caller', { value: 123 }); appears to work in Chrome.

Is that only in sloppy mode?

@dilijev
Copy link
Contributor Author

dilijev commented Feb 5, 2018

@boingoing yes, that is supposed to be allowed. I'm trying to figure out a way to detect that a caller/arguments property has been overwritten or otherwise decide that this regression is worth the fix.

@dilijev dilijev force-pushed the func-restricted-props branch from 64e033f to e9ed67e Compare February 6, 2018 00:26
@dilijev dilijev added this to the 1.8 milestone Feb 6, 2018
@dilijev
Copy link
Contributor Author

dilijev commented Feb 7, 2018

I'm working on a more complete fix for this. Will update soon.

@dilijev
Copy link
Contributor Author

dilijev commented Feb 7, 2018

Closing in favor of a new PR with a more complete fix.

@dilijev
Copy link
Contributor Author

dilijev commented Feb 7, 2018

See #4651

chakrabot pushed a commit that referenced this pull request Feb 8, 2018
…ould not have caller/arguments (and related fixes)

Merge pull request #4651 from dilijev:func-restricted-props

Replaces #4639

Several tests and test baselines needed to be updated to reflect the change in behavior. This change improves caller/arguments behavior without regressing any previous Chakra behavior. Chakra still differs from the spec and other engines on some aspects of caller/arguments.

See: https://tc39.github.io/ecma262/#sec-forbidden-extensions

Fixes #249
Fixes OS#14101048

---

Test262 results strictly improved.

Using test262 commit tc39/test262@03da228:

Previously 44130 passed, now 44138 passed out of 57102. (Duplicates below are strict and non-strict versions of the tests.)

```
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js
```
chakrabot pushed a commit that referenced this pull request Feb 8, 2018
…nctions should not have caller/arguments (and related fixes)

Merge pull request #4651 from dilijev:func-restricted-props

Replaces #4639

Several tests and test baselines needed to be updated to reflect the change in behavior. This change improves caller/arguments behavior without regressing any previous Chakra behavior. Chakra still differs from the spec and other engines on some aspects of caller/arguments.

See: https://tc39.github.io/ecma262/#sec-forbidden-extensions

Fixes #249
Fixes OS#14101048

---

Test262 results strictly improved.

Using test262 commit tc39/test262@03da228:

Previously 44130 passed, now 44138 passed out of 57102. (Duplicates below are strict and non-strict versions of the tests.)

```
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js
```
chakrabot pushed a commit that referenced this pull request Feb 8, 2018
… built-in functions should not have caller/arguments (and related fixes)

Merge pull request #4651 from dilijev:func-restricted-props

Replaces #4639

Several tests and test baselines needed to be updated to reflect the change in behavior. This change improves caller/arguments behavior without regressing any previous Chakra behavior. Chakra still differs from the spec and other engines on some aspects of caller/arguments.

See: https://tc39.github.io/ecma262/#sec-forbidden-extensions

Fixes #249
Fixes OS#14101048

---

Test262 results strictly improved.

Using test262 commit tc39/test262@03da228:

Previously 44130 passed, now 44138 passed out of 57102. (Duplicates below are strict and non-strict versions of the tests.)

```
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js
+PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js
+PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants