Skip to content

Commit

Permalink
Getting function name that includes space return empty string.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=262123
rdar://116406865

Reviewed by Yusuke Suzuki.

http://trac.webkit.org/r200423 introduced a site specific quirk (introduced back in 2016) to work around
the mathjs framework (at https://github.com/josdejong/mathjs) not supporting ES6 function names that
can contain white space.  See https://bugs.webkit.org/show_bug.cgi?id=157246.

Now that mathjs no longer has the offending code, plus both Chrome and Firefox also implements the ES6
spec on this, it's time to remove this quirk.

* LayoutTests/js/dom/regress-157246-expected.txt: Removed.
* LayoutTests/js/dom/regress-157246.html: Removed.
* LayoutTests/js/dom/script-tests/regress-157246.js: Removed.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/JavaScriptCore/runtime/JSFunction.cpp:
(JSC::JSFunction::reifyName):
* Source/JavaScriptCore/runtime/JSFunctionInlines.h:
(JSC::JSFunction::originalName):

Canonical link: https://commits.webkit.org/268838@main
  • Loading branch information
Mark Lam committed Oct 4, 2023
1 parent ba90462 commit 17d73b1
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 69 deletions.
10 changes: 0 additions & 10 deletions LayoutTests/js/dom/regress-157246-expected.txt

This file was deleted.

14 changes: 0 additions & 14 deletions LayoutTests/js/dom/regress-157246.html

This file was deleted.

25 changes: 0 additions & 25 deletions LayoutTests/js/dom/script-tests/regress-157246.js

This file was deleted.

3 changes: 0 additions & 3 deletions LayoutTests/platform/mac-wk1/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1492,9 +1492,6 @@ http/tests/download/convert-cached-load-to-download.html [ Skip ]

webkit.org/b/157007 fast/layers/no-clipping-overflow-hidden-added-after-transform.html [ Pass ImageOnlyFailure ]

# This test relies on a settings option that we can only set with WKRT.
js/dom/regress-157246.html

# dumpPolicyDelegateCallbacks is not supported in DumpRenderTree
fast/loader/iframe-src-invalid-url.html [ Skip ]

Expand Down
8 changes: 0 additions & 8 deletions Source/JavaScriptCore/runtime/JSFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,6 @@ JSFunction::PropertyStatus JSFunction::reifyName(VM& vm, JSGlobalObject* globalO
unsigned initialAttributes = PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly;
const Identifier& propID = vm.propertyNames->name;

if (globalObject->needsSiteSpecificQuirks()) {
auto illegalCharMatcher = [] (UChar ch) -> bool {
return ch == ' ' || ch == '|';
};
if (name.find(illegalCharMatcher) != notFound)
name = String();
}

if (jsExecutable()->isGetter())
name = makeNameWithOutOfMemoryCheck(globalObject, throwScope, "Getter ", "get ", name);
else if (jsExecutable()->isSetter())
Expand Down
10 changes: 1 addition & 9 deletions Source/JavaScriptCore/runtime/JSFunctionInlines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2018 Apple Inc. All rights reserved.
* Copyright (C) 2013-2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -199,14 +199,6 @@ inline JSString* JSFunction::originalName(JSGlobalObject* globalObject)
else
name = ecmaName.string();

if (globalObject->needsSiteSpecificQuirks()) {
auto illegalCharMatcher = [] (UChar ch) -> bool {
return ch == ' ' || ch == '|';
};
if (name.find(illegalCharMatcher) != notFound)
name = String();
}

if (jsExecutable()->isGetter()) {
name = makeNameWithOutOfMemoryCheck(globalObject, scope, "Getter ", "get ", name);
RETURN_IF_EXCEPTION(scope, { });
Expand Down

0 comments on commit 17d73b1

Please sign in to comment.