While working on making WTF build outside of JavaScriptCore I noticed that wtf/DateMath.cpp includes several headers from JavaScriptCore, and makes use of some JavaScriptCore types such as ExecState, JSGlobalData and DSTOffsetCache. This layering violation needs to be addressed before WTF can be correctly split out of JavaScriptCore.
It looks like it may be possible to simply move the USE(JSC) parts of DateMath.h / DateMath.cpp in to a more appropriate file inside JavaScriptCore itself.
Created attachment 115014 [details] Patch
Attachment 115014 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSDateMath.cpp:76: Alphabetical sorting problem. [build/include_order] [4] Source/JavaScriptCore/runtime/JSDateMath.cpp:147: More than one command on the same line in if [whitespace/parens] [4] Source/JavaScriptCore/runtime/JSDateMath.cpp:154: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Source/JavaScriptCore/runtime/JSDateMath.cpp:244: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 4 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 115014 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=115014&action=review >> Source/JavaScriptCore/runtime/JSDateMath.cpp:76 >> #include "ASCIICType.h" > > Alphabetical sorting problem. [build/include_order] [4] Itβs true, ASCIICType.h should come before Assertions.h. > Source/JavaScriptCore/runtime/JSDateMath.cpp:82 > #include "Assertions.h" > #include "ASCIICType.h" > #include "CurrentTime.h" > -#if USE(JSC) > #include "JSObject.h" > -#endif > #include "MathExtras.h" > -#if USE(JSC) > #include "ScopeChain.h" > -#endif > #include "StdLibExtras.h" > #include "StringExtras.h" Is there a chance we could cut these includes down a bit more? Guess someone can look into that later. > Source/JavaScriptCore/wtf/DateMath.h:108 > +using WTF::isLeapYear; > using WTF::dateToDaysFrom1970; Entire "using" list should be sorted alphabetically.
Comment on attachment 115014 [details] Patch Clearing flags on attachment: 115014 Committed r100205: <http://trac.webkit.org/changeset/100205>
All reviewed patches have been landed. Closing bug.